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+ location / {
23+ try_files $uri $uri/ /index.php?$query_string;
24+ location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
25+ expires max;
26+ fastcgi_hide_header "Set-Cookie";
27+ }
28+
29+ location ~ [^/]\.php(/|$) {
30+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
31+ if (!-f $document_root$fastcgi_script_name) {
32+ return 404;
33+ }
34+
35+ fastcgi_pass %backend_lsnr%;
36+ fastcgi_index index.php;
37+ include /etc/nginx/fastcgi_params;
38+ }
39+ }
40+
41+ location /error/ {
42+ alias %home%/%user%/web/%domain%/document_errors/;
43+ }
44+
45+ location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; }
46+ location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
47+ location ~* /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
48+ location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) { return 403; }
49+
50+ location ~ /\.(?!well-known\/) {
51+ deny all;
52+ return 404;
53+ }
54+
55+ location /vstats/ {
56+ alias %home%/%user%/web/%domain%/stats/;
57+ include %home%/%user%/web/%domain%/stats/auth.conf*;
58+ }
59+
60+ include /etc/nginx/conf.d/phpmyadmin.inc*;
61+ include /etc/nginx/conf.d/phppgadmin.inc*;
62+ include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
63+ }
0 commit comments