83 lines
2.2 KiB
Plaintext
83 lines
2.2 KiB
Plaintext
# 服务器最外层 Nginx 示例。
|
|
# 使用前请确认三个本机端口及证书路径与实际环境一致。
|
|
upstream onboardx_admin_web {
|
|
server 127.0.0.1:18081;
|
|
keepalive 16;
|
|
}
|
|
|
|
upstream onboardx_public_web {
|
|
server 127.0.0.1:18082;
|
|
keepalive 16;
|
|
}
|
|
|
|
upstream onboardx_backend {
|
|
server 127.0.0.1:15566;
|
|
keepalive 16;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name onboardx.cnzhyx.cn onboardx-admin.cnzhyx.cn onboardx-api.cnzhyx.cn;
|
|
return 301 https://$host$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
server_name onboardx-admin.cnzhyx.cn;
|
|
|
|
ssl_certificate /etc/nginx/certs/cnzhyx.cn/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/certs/cnzhyx.cn/privkey.pem;
|
|
|
|
location / {
|
|
proxy_pass http://onboardx_admin_web;
|
|
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 443 ssl http2;
|
|
server_name onboardx.cnzhyx.cn;
|
|
|
|
ssl_certificate /etc/nginx/certs/cnzhyx.cn/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/certs/cnzhyx.cn/privkey.pem;
|
|
|
|
location / {
|
|
proxy_pass http://onboardx_public_web;
|
|
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 443 ssl http2;
|
|
server_name onboardx-api.cnzhyx.cn;
|
|
|
|
ssl_certificate /etc/nginx/certs/cnzhyx.cn/fullchain.pem;
|
|
ssl_certificate_key /etc/nginx/certs/cnzhyx.cn/privkey.pem;
|
|
|
|
client_max_body_size 10m;
|
|
|
|
location = /api/open/onboarding/qiyuesuo/callback {
|
|
proxy_pass http://onboardx_backend/open/onboarding/qiyuesuo/callback;
|
|
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_connect_timeout 60s;
|
|
proxy_read_timeout 300s;
|
|
proxy_send_timeout 300s;
|
|
}
|
|
|
|
location / {
|
|
return 404;
|
|
}
|
|
}
|