map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 80; server_name test-mail.shenjianl.cn; return 301 https://$host$request_uri; } server { listen 80; server_name admin-mail.shenjianl.cn; return 301 https://$host$request_uri; } server { listen 443 ssl http2; server_name test-mail.shenjianl.cn; ssl_certificate /etc/nginx/certs/shenjianl.cn.fullchain.pem; ssl_certificate_key /etc/nginx/certs/shenjianl.cn.key; root /site/email-unlimit/frontend/current; index index.html; client_max_body_size 1m; location ~ ^/(auth|api)(/|$) { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; 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 Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_read_timeout 600s; proxy_send_timeout 600s; } location = /health { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location = /index.html { add_header Cache-Control "no-store" always; try_files $uri =404; } location ~* \.(?:css|js|mjs|png|jpg|jpeg|gif|ico|svg|webp|woff2?)$ { expires 1y; add_header Cache-Control "public, immutable" always; try_files $uri =404; } location / { try_files $uri $uri/ /index.html; } } server { listen 443 ssl http2; server_name admin-mail.shenjianl.cn; ssl_certificate /etc/nginx/certs/shenjianl.cn.fullchain.pem; ssl_certificate_key /etc/nginx/certs/shenjianl.cn.key; root /site/email-unlimit/admin/current; index index.html; client_max_body_size 1m; location ~ ^/(auth|api|admin)(/|$) { proxy_pass http://127.0.0.1:3000; proxy_http_version 1.1; 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 Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_read_timeout 600s; proxy_send_timeout 600s; } location ~ ^/(health|info)$ { proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } location = /index.html { add_header Cache-Control "no-store" always; try_files $uri =404; } location ~* \.(?:css|js|mjs|png|jpg|jpeg|gif|ico|svg|webp|woff2?)$ { expires 1y; add_header Cache-Control "public, immutable" always; try_files $uri =404; } location / { try_files $uri $uri/ /index.html; } }