- 反向代理:代理的是服務端
- 正向代理:代理的是客戶端
- nginx反向代理標準配置:
server {
listen 80;
server_name www.xxx.com;
location /aming/
{
proxy_pass http://192.168.1.10:8080/linux/;
proxy_set_header host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
2.解決cookie丟失的問題:
location /proxy_path {
proxy_pass http://127.0.0.1:8080/project;
proxy_cookie_path /project /proxy_path;
}