# Default server configuration # server { listen 80 default_server; listen [::]:80 default_server; access_log /var/log/nginx/tuer.kraut.space_access.log; error_log /var/log/nginx/tuer.kraut.space_error.log; location / { return 301 https://$host$request_uri?; } } server { # SSL configuration # listen 443 ssl default_server; listen [::]:443 ssl default_server; # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # ssl_certificate /etc/nginx/certs/fullchain.pem; ssl_certificate_key /etc/nginx/certs/privkey.pem; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html; server_name tuer.kraut.space; error_page 404 /404.html; location ~ /(404.html|style.css|doc/|media/) { root /var/www/html; # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } location /cgi-bin/kraut.space { return 301 /; } location / { try_files $uri $uri/ /index.html; default_type text/html; gzip off; include fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; fastcgi_param SCRIPT_FILENAME /var/www/cgi-bin/kraut.space; # According to RFC3875 (https://tools.ietf.org/html/rfc3875#section-4.1.14) in SERVER_NAME # we should put actual hostname user came to. For nginx it is in $host # This will allow to run multihost instances fastcgi_param SERVER_NAME $host; } }