1 webconfig中 appsetting 中增加配置
<appSettings> <add key="aspnet:UseHostHeaderForRequestUrl" value="true"/> </appSettings>
2 nginx 配置
upstream www.baidu.com {
server 127.0.0.1:10178 weight=1 fail_timeout=0;
}
server {
listen 80;
listen 443 ssl;
server_name www.baidu.com;
ssl_certificate ./cert/www.baidu.com/1_www.baidu.com_bundle.crt;
ssl_certificate_key ./cert/www.baidu.com/2_www.baidu.com.key;
location / {
proxy_pass http://www.baidu.com;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}