This commit is contained in:
eric
2026-03-23 02:18:43 -05:00
parent 2f73b2ee23
commit 894150d1fa
6 changed files with 73 additions and 17 deletions

View File

@@ -0,0 +1,53 @@
# 腾讯云:将 salon.hackrobot.cn、salonapi.hackrobot.cn 解析到本机公网 IP 后,
# 复制到 /etc/nginx/sites-available/ 并 ln -s 到 sites-enabled再 nginx -t && systemctl reload nginx。
# 需先申请 SSLcertbot 或腾讯云 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;
}