# Evo Zoo — reverse proxy to game server (192.168.1.173:8080)
# Deploy on proxy (192.168.1.100). Enable: sudo ln -sf /path/to/this/file /etc/nginx/sites-enabled/ && sudo nginx -t && sudo systemctl reload nginx
# Cert: sudo certbot --nginx -d evozoo.4nkweb.com

server {
    listen 80;
    listen [::]:80;
    server_name evozoo.4nkweb.com;
    return 301 https://$host$request_uri;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name evozoo.4nkweb.com;

    ssl_certificate     /etc/letsencrypt/live/evozoo.4nkweb.com/fullchain.pem;
    ssl_certificate_key  /etc/letsencrypt/live/evozoo.4nkweb.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    location / {
        proxy_pass http://192.168.1.173:8080;
        proxy_http_version 1.1;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}
