访问首页的时候,可以正常负载均衡。。。但是response.redirect()的时候,后台会自动带上端口跳转,导致页面无法访问。
nginx +iis 如何配置非80端口。
谢谢提示
又遇到一个问题。其他后台页面response.redirect(),经过过滤替换,可以正常跳转。
但是gridview中,
<ItemTemplate>
      <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="False" Text="修改" CommandName="Update" CommandArgument="xg">
</asp:LinkButton>
后台:
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            
                Response.Redirect("/xx.aspx" );
         }
返回给客户端的地址,还是会带上应用服务器的实际端口,nginx无法过滤。
下面是我的nginx.config,www.fl.com是本机的域名。
events {
    worker_connections  1024;
}
http {
    upstream  fl{  
     server   192.168.145.11:8001;
     server   192.168.145.11:8002; 
     ip_hash;
    }
    server {
        listen       80;
        server_name  192.168.145.11;
        location / {
            proxy_pass http://fl/;
            proxy_set_header   Host  $host:$server_port;
            proxy_redirect http://www.fl.com:8001/ http://www.fl.com/;
            proxy_redirect http://www.fl.com:8002/ http://www.fl.com/;
            proxy_connect_timeout       1;
        } 
    }
}
是不是asp.net经过一系列处理,最终把LinkButton变成一个<a href="ip:port/xx.aspx">,其实我们访问的是服务器返回的地址,这个地址没有经过nginx过滤???
请问,您遇到过吗