28 lines
1.0 KiB
Plaintext
28 lines
1.0 KiB
Plaintext
# hr-web 测试环境 Nginx 反代样例(备用,实际远程部署由部署任务执行)
|
||
# server_name: hrstest.opencomputing.cn -> 127.0.0.1:9280
|
||
# HTTPS: 预留 certbot --nginx 自动改写(执行 `certbot --nginx -d hrstest.opencomputing.cn`)
|
||
server {
|
||
listen 80;
|
||
listen [::]:80;
|
||
server_name hrstest.opencomputing.cn;
|
||
|
||
# 健康检查(供负载/监控探活,转发到 ahserver)
|
||
location = /health {
|
||
proxy_pass http://127.0.0.1:9280;
|
||
proxy_set_header Host $host;
|
||
access_log off;
|
||
}
|
||
|
||
location / {
|
||
proxy_pass http://127.0.0.1:9280;
|
||
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_read_timeout 60s;
|
||
}
|
||
}
|
||
|
||
# 说明:certbot --nginx 会在上面 server 块上自动追加 443 listen 与 ssl_certificate 指令,
|
||
# 并将 80 端口的匹配请求重定向到 HTTPS,本文件保持可被 certbot 安全改写的最小结构。
|