54 lines
1.7 KiB
Plaintext
54 lines
1.7 KiB
Plaintext
# 腾讯云:将 salon.hackrobot.cn、salonapi.hackrobot.cn 解析到本机公网 IP 后,
|
||
# 复制到 /etc/nginx/sites-available/ 并 ln -s 到 sites-enabled,再 nginx -t && systemctl reload nginx。
|
||
# 需先申请 SSL(certbot 或腾讯云 SSL 证书),把证书路径替换为实际路径。
|
||
|
||
# ---------- salon 前端(Next.js 建议 Node 监听 127.0.0.1:3002,由 Nginx 反代)----------
|
||
server {
|
||
listen 443 ssl http2;
|
||
server_name salon.hackrobot.cn;
|
||
|
||
ssl_certificate /etc/nginx/ssl/salon.hackrobot.cn/fullchain.pem;
|
||
ssl_certificate_key /etc/nginx/ssl/salon.hackrobot.cn/privkey.pem;
|
||
|
||
location / {
|
||
proxy_pass http://127.0.0.1:3002;
|
||
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;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name salon.hackrobot.cn;
|
||
return 301 https://$host$request_uri;
|
||
}
|
||
|
||
# ---------- salonapi 后端(uvicorn 建议 127.0.0.1:8007)----------
|
||
server {
|
||
listen 443 ssl http2;
|
||
server_name salonapi.hackrobot.cn;
|
||
|
||
ssl_certificate /etc/nginx/ssl/salonapi.hackrobot.cn/fullchain.pem;
|
||
ssl_certificate_key /etc/nginx/ssl/salonapi.hackrobot.cn/privkey.pem;
|
||
|
||
client_max_body_size 50m;
|
||
|
||
location / {
|
||
proxy_pass http://127.0.0.1:8007;
|
||
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;
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 80;
|
||
server_name salonapi.hackrobot.cn;
|
||
return 301 https://$host$request_uri;
|
||
}
|