traefik_yourls/nginx-conf/nginx.conf
2023-11-26 17:20:07 +01:00

55 lines
1.1 KiB
Nginx Configuration File

# nginx.conf
server {
listen 80;
listen [::]:80;
server_name yourls.localhost;
index index.php index.html index.htm;
allow all;
root /var/www/html;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy "no-referrer-when-downgrade" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/([\w-]+\+?)/?$ /yourls-loader.php?id=$1 last;
}
location /. {
return 404;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass devaltogether_yourls_fpm:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~ /\.ht {
deny all;
}
location = /favicon.ico {
log_not_found off; access_log off;
}
location = /robots.txt {
log_not_found off; access_log off; allow all;
}
location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
log_not_found off;
}
}