server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name panic-shack.hallada.net;
    root /var/www/panic-shack;

    ssl_certificate /etc/letsencrypt/live/panic-shack.hallada.net/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/panic-shack.hallada.net/privkey.pem;
    ssl_trusted_certificate /etc/letsencrypt/live/panic-shack.hallada.net/fullchain.pem;

    location /notify {
        deny all;
        return 404;
    }

    location /config {
        deny all;
        return 404;
    }

    location / {
        try_files $uri $uri/ $uri.php?$args =404;
    }

    location /old-worlds {
        autoindex on;
        try_files $uri $uri/ $uri.php?$args =404;
    }

    location /chat {
        include uwsgi_params;
        proxy_set_header X-Forwarded-Host $host:$server_port; proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://unix:/var/www/panic-shack/chat/minecraft-chat.sock;
    }
}
