生产服务器:
server {
listen 80; # 监听端口
server_name api.rstone.com.cn; # 域名
location / {
proxy_pass http://172.19.0.1:8080/; # 代理目标地址
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; # 设置代理请求头
}
}
- nginx admin.rstone.com.cn
server {
listen 80; # 监听端口
server_name admin.rstone.com.cn; # 域名
location / {
root /usr/share/nginx/html/hw.rstone.com.cn/admin;
try_files $uri $uri/ @routerblog;
index index.html index.htm;
}
location @routerblog{
rewrite ^.*$ /index.html last;
}
}