server { listen 443 ssl; listen [::]:443 ssl; ssl_certificate /etc/letsencrypt/live/of.pipeframe.xyz/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/of.pipeframe.xyz/privkey.pem; server_name of.pipeframe.xyz; error_page 404 =404 @empty_json; error_page 403 =403 @empty_json; root /var/www/of-api; location / { try_files $uri $uri/ =404; } location @empty_json { return 404 "{}"; } } server { listen 80; listen [::]:80; server_name of.pipeframe.xyz; return 301 https://of.pipeframe.xyz$request_uri; }