From b442179b5850fbde4776ce9d0c7c04f21e1cded6 Mon Sep 17 00:00:00 2001 From: wikiboss Date: Wed, 23 Sep 2026 11:50:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(nginx):=20=E5=A2=9E=E5=8A=A0/open/=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=8F=8D=E5=90=91=E4=BB=A3=E7=90=86=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BB=A5=E6=94=AF=E6=8C=81=E5=BE=AE=E5=AE=98=E7=BD=91=E9=A2=84?= =?UTF-8?q?=E8=A7=88=E7=9B=B4=E9=93=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- deploy/nginx-a9.xxzlw.com.conf | 118 +++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 deploy/nginx-a9.xxzlw.com.conf diff --git a/deploy/nginx-a9.xxzlw.com.conf b/deploy/nginx-a9.xxzlw.com.conf new file mode 100644 index 0000000..823b060 --- /dev/null +++ b/deploy/nginx-a9.xxzlw.com.conf @@ -0,0 +1,118 @@ +upstream omnicard_api { + server 127.0.0.1:9000; + keepalive 16; +} + +server +{ + listen 80; + listen 443 ssl; + listen 443 quic; + listen [::]:443 ssl; + listen [::]:443 quic; + http2 on; + listen [::]:80; + server_name a9.xxzlw.com; + index index.html; + root /www/wwwroot/a9.xxzlw.com/public; + + include /www/server/panel/vhost/nginx/well-known/a9.xxzlw.com.conf; + + ssl_certificate /www/server/panel/vhost/cert/a9.xxzlw.com/fullchain.pem; + ssl_certificate_key /www/server/panel/vhost/cert/a9.xxzlw.com/privkey.pem; + ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; + ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5; + ssl_prefer_server_ciphers on; + ssl_session_tickets on; + ssl_session_cache shared:SSL:10m; + ssl_session_timeout 10m; + add_header Strict-Transport-Security "max-age=31536000"; + add_header Alt-Svc 'quic=":443"; h3=":443"; h3-29=":443"; h3-27=":443";h3-T050=":443"; h3-Q050=":443";h3-Q049=":443";h3-Q048=":443"; h3-Q046=":443"; h3-Q043=":443"'; + error_page 497 https://$host$request_uri; + + location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md) + { + return 404; + } + + location ~ \.well-known{ + allow all; + } + + if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) { + return 403; + } + + location /open/ + { + proxy_pass http://omnicard_api/open/; + 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 REMOTE-HOST $remote_addr; + } + + location /api/ + { + proxy_pass http://omnicard_api/; + 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 REMOTE-HOST $remote_addr; + proxy_connect_timeout 3000s; + proxy_read_timeout 86400s; + proxy_send_timeout 3000s; + proxy_buffering off; + proxy_cache off; + proxy_http_version 1.1; + proxy_set_header Connection ''; + chunked_transfer_encoding off; + } + + location /socket + { + proxy_pass http://omnicard_api/socket; + proxy_connect_timeout 3600s; + proxy_read_timeout 3600s; + proxy_send_timeout 3600s; + 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 REMOTE-HOST $remote_addr; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_redirect off; + } + + location /upload/ + { + proxy_pass http://omnicard_api/upload/; + 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; + } + + location / + { + try_files $uri $uri/ /index.html; + } + + location ~* \.(gif|jpg|jpeg|png|bmp|svg|ico|webp)$ + { + expires 30d; + access_log off; + } + + location ~* \.(js|css|woff2?)$ + { + expires 12h; + access_log off; + } + + access_log /www/wwwlogs/a9.xxzlw.com.log; + error_log /www/wwwlogs/a9.xxzlw.com.error.log; +}