|
|
@@ -1,5 +1,12 @@
|
|
|
server {
|
|
|
listen 80 default_server;
|
|
|
+ server_name _;
|
|
|
+
|
|
|
+ # Public HTTP is redirect-only. Never serve pages or proxy application traffic over plaintext.
|
|
|
+ return 308 https://$host$request_uri;
|
|
|
+}
|
|
|
+
|
|
|
+server {
|
|
|
listen 443 ssl default_server;
|
|
|
http2 on;
|
|
|
ssl_certificate /etc/nginx/certs/gzhxtc.edu.cn/server.crt;
|
|
|
@@ -24,6 +31,36 @@ server {
|
|
|
return 404;
|
|
|
}
|
|
|
|
|
|
+ location ^~ /web/upload/modules/sys/improt/ {
|
|
|
+ if ($uri ~* "\.(jsp|jspx|class|war|php|phtml|sh)$") { return 404; }
|
|
|
+ if ($uri ~ "/\.zq-(quarantine|stage)") { return 404; }
|
|
|
+ proxy_pass http://10.0.42.6:8080;
|
|
|
+ proxy_set_header Host $host;
|
|
|
+ proxy_set_header X-Real-IP $remote_addr;
|
|
|
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
+ proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
+ proxy_set_header X-Forwarded-Port $server_port;
|
|
|
+ proxy_set_header X-Forwarded-Host $host;
|
|
|
+ proxy_connect_timeout 60s;
|
|
|
+ proxy_send_timeout 1800s;
|
|
|
+ proxy_read_timeout 1800s;
|
|
|
+ }
|
|
|
+
|
|
|
+ location ^~ /web/upload/modules/sys/upload/ {
|
|
|
+ if ($uri ~* "\.(jsp|jspx|class|war|php|phtml|sh)$") { return 404; }
|
|
|
+ if ($uri ~ "/\.zq-(quarantine|stage)") { return 404; }
|
|
|
+ proxy_pass http://10.0.42.6:8080;
|
|
|
+ proxy_set_header Host $host;
|
|
|
+ proxy_set_header X-Real-IP $remote_addr;
|
|
|
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
+ proxy_set_header X-Forwarded-Proto $scheme;
|
|
|
+ proxy_set_header X-Forwarded-Port $server_port;
|
|
|
+ proxy_set_header X-Forwarded-Host $host;
|
|
|
+ proxy_connect_timeout 60s;
|
|
|
+ proxy_send_timeout 1800s;
|
|
|
+ proxy_read_timeout 1800s;
|
|
|
+ }
|
|
|
+
|
|
|
location ^~ /web/upload/ {
|
|
|
if ($uri ~* "\.(jsp|jspx|class|war|php|phtml|sh)$") { return 404; }
|
|
|
if ($uri ~ "/\.zq-(quarantine|stage)") { return 404; }
|