辉克's Blog

创造机会的人是勇者;等待机会的人是愚者

nginx 反向代理iis支持 ASP脚本设置

  #asp(aspx)支持,将客户端的请求转交给IIS

  location ~* \.(asp|aspx|asa)$ {

  root D:/wwroot;

  index index.asp index.aspx;

  proxy_pass http://127.0.0.1:88;

  proxy_set_header X-Real-IP $remote_addr;

  }

  将上面这段放在nginx.conf里。范围是在 你需要支持ASP站的Serer内 那段里。其次就是开启IIS的站点。端口用88(可自行修改),站点指向要对应nginx设置的站点。这样才能支持。

  下面是我找到的页面的全文章,或许对你们也有用:

  引用内容

  以下是nginx配置文件,有一点要注意,不管先装或者后装IIS,都需要修改IIS的默认端口,然后相应的修改配置文件里的IIS相关端口

  #asp(aspx)支持,将客户端的请求转交给IIS

  location ~* \.(asp|aspx|asa)$ {

  root /host/wwwroot/www;

  index index.asp index.aspx;

  proxy_pass http://127.0.0.1:88;

  proxy_set_header X-Real-IP $remote_addr;

  }

  #java(jsp)支持,将客户端的请求转交给resin

  location ~* \.(jsp|do)$ {

  root /host/wwwroot/www;

  index index.jsp index.do;

  proxy_pass http://127.0.0.1:8080;

  proxy_set_header X-Real-IP $remote_addr;

  }

  #将客户端的请求转交给fastcgi

  location ~ .*\.(php|php5|php4|shtml|xhtml|phtml|htm|html|shtml|shtm)?$ {

  fastcgi_pass 127.0.0.1:9000;

  include /host/nginx/conf/fastcgi_params;

  }

  目的是借助nginx的处理能力把php和静态等页面交给nginx处理,iis只负责处理asp和aspx相关内容,resin只处理java相关内容,所有内容从nginx 80端口输出

, ,

发表回复