|
| 1 | +## Version 2025/11/10 - Changelog: https://github.com/linuxserver/docker-speedtest-tracker/commits/main/root/defaults/nginx/site-confs/default.conf.sample |
| 2 | + |
| 3 | +server { |
| 4 | + listen 80 default_server; |
| 5 | + listen [::]:80 default_server; |
| 6 | + listen 443 ssl default_server; |
| 7 | + listen [::]:443 ssl default_server; |
| 8 | + listen 443 quic reuseport default_server; |
| 9 | + listen [::]:443 quic reuseport default_server; |
| 10 | + |
| 11 | + server_name _; |
| 12 | + |
| 13 | + include /config/nginx/ssl.conf; |
| 14 | + |
| 15 | + set $root /app/www/public; |
| 16 | + if (!-d /app/www/public) { |
| 17 | + set $root /config/www; |
| 18 | + } |
| 19 | + root $root; |
| 20 | + index index.html index.htm index.php; |
| 21 | + |
| 22 | + location / { |
| 23 | + # enable for basic auth |
| 24 | + #auth_basic "Restricted"; |
| 25 | + #auth_basic_user_file /config/nginx/.htpasswd; |
| 26 | + |
| 27 | + try_files $uri $uri/ /index.html /index.htm /index.php$is_args$args; |
| 28 | + } |
| 29 | + |
| 30 | + location ~ ^(.+\.php)(.*)$ { |
| 31 | + # enable the next two lines for http auth |
| 32 | + #auth_basic "Restricted"; |
| 33 | + #auth_basic_user_file /config/nginx/.htpasswd; |
| 34 | + |
| 35 | + fastcgi_split_path_info ^(.+\.php)(.*)$; |
| 36 | + if (!-f $document_root$fastcgi_script_name) { return 404; } |
| 37 | + fastcgi_pass 127.0.0.1:9000; |
| 38 | + fastcgi_index index.php; |
| 39 | + fastcgi_buffers 16 4k; |
| 40 | + fastcgi_buffer_size 16k; |
| 41 | + include /etc/nginx/fastcgi_params; |
| 42 | + } |
| 43 | + |
| 44 | + # deny access to .htaccess/.htpasswd files |
| 45 | + location ~ /\.ht { |
| 46 | + deny all; |
| 47 | + } |
| 48 | +} |
0 commit comments