Nginx¶
If you do not want to expose pokemongo-map to the web directly or you want to place it under a prefix, follow this guide:
Assuming the following:
- You are running pokemongo-map on the default port 5000
- You’ve already made your machine available externally (for example, port forwarding)
Install nginx (I’m not walking you through that, google will assist) - http://nginx.org/en/linux_packages.html
In /etc/nginx/nginx.conf add the following before the last
}
include conf.d/pokemongo-map.conf;
Create a file /etc/nginx/conf.d/pokemongo-map.conf and place the following in it:
server { location /go/ { proxy_pass http://127.0.0.1:5000/; } }
You can now access it by http://yourip/go
Add a free SSL Certificate to your site:¶
https://certbot.eff.org/#debianjessie-nginx
For webroot configuration, simplest for this use, do the following:
- Edit your
/etc/nginx/conf.d/pokemongo-map.conf
- Add the following location block:
location /.well-known/acme-challenge { default_type "text/plain"; root /var/www/certbot; }
- Edit your
Create the root folder above
mkdir /var/www/certbot
Set your permissions for the folder
Run
certbot certonly -w /var/www/certbot -d yourdomain.something.com
Certificates last for 3 Months and can be renewed by running
certbot renew
Example Config¶
server {
listen 80;
server_name PokeMaps.yourdomain.com;
location /.well-known/acme-challenge {
default_type "text/plain";
root /var/www/certbot;
}
# Forces all other requests to HTTPS
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
server_name PokeMaps.yourdomain.com;
location /go/ {
proxy_pass http://127.0.0.1:5000/;
proxy_redirect off;
}
}