nginx反向代理IIS

c2e8gylq  于 2023-05-06  发布在  Nginx
关注(0)|答案(1)|浏览(192)

当我尝试进入〈z://www.aaacom/iis 2002〉时,它转到了我的网芯IIS站点〈z://www.aaa.com:2002〉,但是跳转页面,变成了〈z:www.aaa.com/index.html〉而不是〈z:www.aaa.com:2002/index.html〉,我想是我的网芯改变了IIS站点需要配合什么?还是我的nginx配置本身有问题?


` server { listen 443 ssl;服务器名称www.aaa.com;

ssl_certificate      sslkey/71_www.aaa.com.pem;
    ssl_certificate_key  sslkey/71_www.aaa.com.key;

    ssl_session_cache    shared:SSL:1m;
    ssl_session_timeout  5m;

    ssl_ciphers  HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers  on;

    location / {         
        proxy_pass z://127.0.0.1:4430;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }

   
    location = / {          
        proxy_pass z://127.0.0.1:4430/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
    

location /iis2002 {     
        proxy_pass z://www.aaa.com:2002;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }           

    
    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   html;
    }

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
}`

正确跳转到〈z://www.aaa.com:2002〉

tkclm6bt

tkclm6bt1#

尝试在配置中添加主机端口,并检查这是否适合您:

proxy_set_header Host $host:$server_port;

相关问题