doorito/nginx.site.conf
2024-04-19 18:26:59 +02:00

57 lines
1.5 KiB
Text

# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
location / {
return 301 https://tuer.kraut.space/$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/ssl/private/tuer.kraut.space/fullchain.pem;
ssl_certificate_key /etc/ssl/private/tuer.kraut.space/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/tuer.kraut.space/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/tuer.kraut.space/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;
}
}