1+ # Server (http)
2+ server {
3+ listen 8080;
4+ listen [::]:8080;
5+ server_name _;
6+
7+ # disable any limits to avoid HTTP 413 for large image uploads
8+ client_max_body_size 0;
9+
10+ # Error Page
11+ location @error_page {
12+ add_header Content-Type text/plain;
13+ return 200 'Maintenance mode!';
14+ }
15+
16+ ##############################################
17+ # Use this Block for access also over http !
18+ ##############################################
19+
20+ root /var/www/html;
21+ index index.php index.html test.php;
22+
23+ location / {
24+ #root /var/www/html;
25+ #index index.php index.html;
26+
27+ try_files $uri $uri/ /index.php?$query_string;
28+ }
29+
30+ location ~ \.php$ {
31+ #root /var/www/html;
32+
33+ try_files $uri =404;
34+
35+ fastcgi_pass wsc-php:9000;
36+ fastcgi_index index.php;
37+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
38+ include fastcgi_params;
39+
40+ # Error Page (redirect)
41+ error_page 502 503 504 = @error_page;
42+ }
43+
44+ ##############################################
45+ # Use this Block for redirect to https !
46+ ##############################################
47+
48+ #location / {
49+ # return 301 https://$server_name$request_uri;
50+ #}
51+
52+ #location ^~ /.well-known/acme-challenge/ {
53+ # default_type "text/plain";
54+ # root /tmp/letsencrypt-webroot;
55+ #}
56+
57+ ##############################################
58+ # --------------------------------------------
59+ ##############################################
60+
61+ # nginx status
62+ location = /nginx_status {
63+ stub_status on;
64+ access_log off;
65+ allow 127.0.0.1;
66+ allow 10.0.0.0/8;
67+ allow 172.16.0.0/12;
68+ allow 192.168.0.0/16;
69+ allow ::1;
70+ allow fd00::/8;
71+ deny all;
72+ }
73+
74+ # nginx ping
75+ location = /nginx_ping {
76+ add_header Content-Type text/plain;
77+ return 200 'pong';
78+ access_log off;
79+ allow 127.0.0.1;
80+ allow 10.0.0.0/8;
81+ allow 172.16.0.0/12;
82+ allow 192.168.0.0/16;
83+ allow ::1;
84+ allow fd00::/8;
85+ deny all;
86+ }
87+
88+ # php-fpm status/ping
89+ location ~ ^/(php_fpm_status|php_fpm_ping)$ {
90+ fastcgi_pass wsc-php:9001;
91+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
92+ include fastcgi_params;
93+ access_log off;
94+ allow 127.0.0.1;
95+ allow 10.0.0.0/8;
96+ allow 172.16.0.0/12;
97+ allow 192.168.0.0/16;
98+ allow ::1;
99+ allow fd00::/8;
100+ deny all;
101+
102+ # Error Page (redirect)
103+ error_page 502 503 504 = @error_page;
104+ }
105+
106+ location ~ /\.ht {
107+ deny all;
108+ }
109+ #location = /favicon.ico { log_not_found off; access_log off; }
110+ #location = /robots.txt { log_not_found off; access_log off; }
111+ }
112+
113+ # Server (https)
114+ server {
115+ # TCP (HTTPS)
116+ listen 8443 ssl reuseport;
117+ listen [::]:8443 ssl reuseport;
118+ http2 on;
119+
120+ # UDP (QUIC / HTTP/3)
121+ listen 8443 quic reuseport;
122+ listen [::]:8443 quic reuseport;
123+ http3 on;
124+
125+ # Advertise HTTP/3 availability
126+ add_header Alt-Svc 'h3=":443"; ma=86400';
127+ #add_header Alt-Svc 'h3=":443"; ma=86400' always;
128+
129+ server_name _;
130+
131+ # # https://raymii.org/s/tutorials/Strong_SSL_Security_On_nginx.html
132+ ssl_certificate /ssl/ssl.crt;
133+ ssl_certificate_key /ssl/ssl.key;
134+ ssl_prefer_server_ciphers on;
135+ ssl_session_cache shared:SSL:10m;
136+ ssl_session_timeout 10m;
137+ ssl_protocols TLSv1.2 TLSv1.3;
138+ ssl_ciphers ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384;
139+ # openssl dhparam -out dhparam.pem 4096
140+ #ssl_dhparam /ssl/dhparam.pem;
141+ #ssl_ecdh_curve secp384r1
142+
143+ # disable any limits to avoid HTTP 413 for large image uploads
144+ client_max_body_size 0;
145+
146+ # Error Page
147+ location @error_page {
148+ add_header Content-Type text/plain;
149+ return 200 'Maintenance mode!';
150+ }
151+
152+ root /var/www/html;
153+ index index.php index.html test.php;
154+
155+ location / {
156+ #root /var/www/html;
157+ #index index.php index.html;
158+
159+ try_files $uri $uri/ /index.php?$query_string;
160+ }
161+
162+ location ~ \.php$ {
163+ #root /var/www/html;
164+
165+ try_files $uri =404;
166+
167+ fastcgi_pass wsc-php:9000;
168+ fastcgi_index index.php;
169+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
170+ include fastcgi_params;
171+
172+ # Error Page (redirect)
173+ error_page 502 503 504 = @error_page;
174+ }
175+
176+ # nginx status
177+ location = /nginx_status {
178+ stub_status on;
179+ access_log off;
180+ allow 127.0.0.1;
181+ allow 10.0.0.0/8;
182+ allow 172.16.0.0/12;
183+ allow 192.168.0.0/16;
184+ allow ::1;
185+ allow fd00::/8;
186+ deny all;
187+ }
188+
189+ # nginx ping
190+ location = /nginx_ping {
191+ add_header Content-Type text/plain;
192+ return 200 'pong';
193+ access_log off;
194+ allow 127.0.0.1;
195+ allow 10.0.0.0/8;
196+ allow 172.16.0.0/12;
197+ allow 192.168.0.0/16;
198+ allow ::1;
199+ allow fd00::/8;
200+ deny all;
201+ }
202+
203+ # php-fpm status/ping
204+ location ~ ^/(php_fpm_status|php_fpm_ping)$ {
205+ fastcgi_pass wsc-php:9001;
206+ fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
207+ include fastcgi_params;
208+ access_log off;
209+ allow 127.0.0.1;
210+ allow 10.0.0.0/8;
211+ allow 172.16.0.0/12;
212+ allow 192.168.0.0/16;
213+ allow ::1;
214+ allow fd00::/8;
215+ deny all;
216+
217+ # Error Page (redirect)
218+ error_page 502 503 504 = @error_page;
219+ }
220+
221+ location ~ /\.ht {
222+ deny all;
223+ }
224+ #location = /favicon.ico { log_not_found off; access_log off; }
225+ #location = /robots.txt { log_not_found off; access_log off; }
226+ }
0 commit comments