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; +}