open-contracting / deploy

Deployment configuration and scripts
https://ocdsdeploy.readthedocs.io/en/latest/
Apache License 2.0
2 stars 3 forks source link

nginx: Configure default and fqdn sites, similar to Apache #477

Closed jpmckinney closed 7 months ago

jpmckinney commented 8 months ago

i.e. display the styled 404 page, with a TLS certificate for the FQDN and an HTTPS redirect for the default (IP).

The default /etc/nginx/sites-available/default is (excluding comments):

server {
    listen 80 default_server;
    listen [::]:80 default_server;

    root /var/www/html;

    index index.html index.htm index.nginx-debian.html;

    server_name _;

    location / {
        try_files $uri $uri/ =404;
    }
}