|
| 1 | +#=======================================================================# |
| 2 | +# Default Web Domain Template # |
| 3 | +# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS # |
| 4 | +#=======================================================================# |
| 5 | + |
| 6 | +server { |
| 7 | + listen %ip%:%web_ssl_port% ssl http2; |
| 8 | + server_name %domain_idn% %alias_idn%; |
| 9 | + root %sdocroot%; |
| 10 | + index index.php index.html index.htm; |
| 11 | + access_log /var/log/nginx/domains/%domain%.log combined; |
| 12 | + access_log /var/log/nginx/domains/%domain%.bytes bytes; |
| 13 | + error_log /var/log/nginx/domains/%domain%.error.log error; |
| 14 | + |
| 15 | + ssl_certificate %ssl_pem%; |
| 16 | + ssl_certificate_key %ssl_key%; |
| 17 | + ssl_stapling on; |
| 18 | + ssl_stapling_verify on; |
| 19 | + |
| 20 | + include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*; |
| 21 | + |
| 22 | + # Add headers to serve security related headers |
| 23 | + add_header X-Content-Type-Options nosniff; |
| 24 | + add_header X-XSS-Protection "1; mode=block"; |
| 25 | + add_header X-Robots-Tag none; |
| 26 | + add_header X-Download-Options noopen; |
| 27 | + add_header X-Permitted-Cross-Domain-Policies none; |
| 28 | + add_header Referrer-Policy no-referrer; |
| 29 | + |
| 30 | + location = /robots.txt { |
| 31 | + allow all; |
| 32 | + log_not_found off; |
| 33 | + access_log off; |
| 34 | + } |
| 35 | + |
| 36 | + # set max upload size |
| 37 | + client_max_body_size 512M; |
| 38 | + |
| 39 | + # Disable gzip to avoid the removal of the ETag header |
| 40 | + gzip off; |
| 41 | + |
| 42 | + # Uncomment if your server is build with the ngx_pagespeed module |
| 43 | + # This module is currently not supported. |
| 44 | + #pagespeed off; |
| 45 | + |
| 46 | + error_page 403 /core/templates/403.php; |
| 47 | + error_page 404 /core/templates/404.php; |
| 48 | + |
| 49 | + location / { |
| 50 | + try_files $uri $uri/ /index.php; |
| 51 | + } |
| 52 | + |
| 53 | + location ~ \.php$ { |
| 54 | + include fastcgi_params; |
| 55 | + fastcgi_split_path_info ^(.+\.php)(/.*)$; |
| 56 | + try_files $fastcgi_script_name =404; |
| 57 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 58 | + fastcgi_param PATH_INFO $fastcgi_path_info; |
| 59 | + #Avoid sending the security headers twice |
| 60 | + fastcgi_param modHeadersAvailable true; |
| 61 | + fastcgi_param front_controller_active true; |
| 62 | + fastcgi_pass unix:/run/php/php7.4-fpm.sock; |
| 63 | + fastcgi_intercept_errors on; |
| 64 | + fastcgi_request_buffering off; |
| 65 | + } |
| 66 | + |
| 67 | + location ~* \.(?:svg|gif|png|html|ttf|woff|ico|jpg|jpeg)$ { |
| 68 | + try_files $uri /index.php$uri$is_args$args; |
| 69 | + # Optional: Don't log access to other assets |
| 70 | + access_log off; |
| 71 | + } |
| 72 | + |
| 73 | + location /error/ { |
| 74 | + alias %home%/%user%/web/%domain%/document_errors/; |
| 75 | + } |
| 76 | + |
| 77 | + location ~ /\.(?!well-known\/) { |
| 78 | + deny all; |
| 79 | + return 404; |
| 80 | + } |
| 81 | + |
| 82 | + location /vstats/ { |
| 83 | + alias %home%/%user%/web/%domain%/stats/; |
| 84 | + include %home%/%user%/web/%domain%/stats/auth.conf*; |
| 85 | + } |
| 86 | + |
| 87 | + include /etc/nginx/conf.d/phpmyadmin.inc*; |
| 88 | + include /etc/nginx/conf.d/phppgadmin.inc*; |
| 89 | + include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*; |
| 90 | +} |
0 commit comments