Files
shell-scripts/2-NGINX相关/nginx安装/test.conf
2025-07-10 16:49:54 +08:00

49 lines
1.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

server {
listen 80;
server_name heshun-admin.doublecheer.com;
# 强制将所有HTTP请求重定向到HTTPS
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name heshun-admin.doublecheer.com;
# SSL配置
ssl_certificate /path/to/your/certificate.crt;
ssl_certificate_key /path/to/your/private.key;
# 其他SSL配置可选
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
# 处理所有URI
location / {
root /home/hs/web/platform;
index index.html index.htm;
try_files $uri $uri/ @router;
}
location /prod-api/ {
rewrite ^/prod-api/(.*) /$1 break;
#两个反斜杆
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_pass http://127.0.0.1:30700;
}
location /play-api/ {
rewrite ^/play-api/(.*) /$1 break;
#两个反斜杆
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_pass http://127.0.0.1:30720;
}
location @router {
rewrite ^.*$ /index.html last;
}
}