前端web: http://web.demo.com
后端服务: http://api.demo.com
web域名网站 nginx配置文件如下
location /prod-api/
{
proxy_pass http://api.demo.com/;
proxy_set_header Host api.demo.com;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
add_header Cache-Control no-cache;
expires 12h;
}