20 lines
556 B
Plaintext
20 lines
556 B
Plaintext
server {
|
|
listen 80;
|
|
server_name _; # 修改为你的域名或者服务器IP
|
|
|
|
# 静态文件服务
|
|
location / {
|
|
root /var/www/html; # 设置网页根目录为 /var/www/html
|
|
index index.html; # 设置默认首页文件
|
|
}
|
|
|
|
# API转发
|
|
location /api {
|
|
proxy_pass http://192.168.202.220:9100; # 将 /api 的请求转发到 http://127.0.0.1:9100
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
}
|
|
}
|
|
|