RT
请求
www.abc.com/action?id=1
的时候forward到
www.def.com/action?id=1
么
找到一个
https://calvin.me/forward-ip-addresses-when-using-nginx-proxy/
# redirect calvin.me to https
server {
listen 80 default_server;
server_name calvin.me;
return 301 https://calvin.me;
}
# redirect www prefix to https
server {
listen 80;
server_name www.calvin.me;
return 301 https://www.calvin.me;
}
server {
#listen 80;
listen 443 ssl default_server;
server_name calvin.me;
ssl_certificate /etc/nginx/ssl/calvin.me.crt;
ssl_certificate_key /etc/nginx/ssl/calvin.me.key;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Host $remote_addr;
proxy_pass http://wp.calvin.me;
}
}