|
| 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 %docroot%; |
| 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 | + client_max_body_size 1G; |
| 23 | + client_body_buffer_size 1024k; |
| 24 | + |
| 25 | + location = /favicon.ico { |
| 26 | + log_not_found off; |
| 27 | + access_log off; |
| 28 | + } |
| 29 | + |
| 30 | + location = /robots.txt { |
| 31 | + allow all; |
| 32 | + log_not_found off; |
| 33 | + access_log off; |
| 34 | + } |
| 35 | + |
| 36 | + location ~ /\.(?!well-known\/) { |
| 37 | + deny all; |
| 38 | + return 404; |
| 39 | + } |
| 40 | + |
| 41 | + location ~* /(app|content|lib)/.*\.(po|php|lock|sql)$ { |
| 42 | + deny all; |
| 43 | + } |
| 44 | + |
| 45 | + location ~* /.*\.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js) { |
| 46 | + add_header Access-Control-Allow-Origin "*"; |
| 47 | + } |
| 48 | + |
| 49 | + location ^~ /images/ { |
| 50 | + location ~* (jpe?g|png|gif) { |
| 51 | + log_not_found off; |
| 52 | + error_page 404 /content/images/system/default/404.gif; |
| 53 | + } |
| 54 | + return 403; |
| 55 | + } |
| 56 | + |
| 57 | + location / { |
| 58 | + try_files $uri $uri/ /index.php?$args; |
| 59 | + |
| 60 | + location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ { |
| 61 | + expires 30d; |
| 62 | + fastcgi_hide_header "Set-Cookie"; |
| 63 | + } |
| 64 | + |
| 65 | + location ~ [^/]\.php(/|$) { |
| 66 | + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; |
| 67 | + try_files $uri =404; |
| 68 | + fastcgi_pass %backend_lsnr%; |
| 69 | + fastcgi_index index.php; |
| 70 | + include /etc/nginx/fastcgi_params; |
| 71 | + include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*; |
| 72 | + } |
| 73 | + } |
| 74 | + |
| 75 | + location /error/ { |
| 76 | + alias %home%/%user%/web/%domain%/document_errors/; |
| 77 | + } |
| 78 | + |
| 79 | + location /vstats/ { |
| 80 | + alias %home%/%user%/web/%domain%/stats/; |
| 81 | + include %home%/%user%/web/%domain%/stats/auth.conf*; |
| 82 | + } |
| 83 | + |
| 84 | + include /etc/nginx/conf.d/phpmyadmin.inc*; |
| 85 | + include /etc/nginx/conf.d/phppgadmin.inc*; |
| 86 | + include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*; |
| 87 | +} |
0 commit comments