IIS重定向,Nginx代理转发
由于IIS服务器应用配置复杂,所以不建议配置IIS应用服务器代理,配置IIS服务器重定向到Nginx代理服务器,由Nginx代理转发IIS应用服务。
1、 在IIS中创建应用程序
比如在80端口服务下创建test目录。
2、选中对应的应用目录,选择重定向功能,指定访问该目录如(xx.xx.xx.xx/test)的时候,跳转的地址如(xx.xx.xx.xx:800/test)
Nginx代理转发
1,在nginx目录下 打开 conf--->nginx.conf
server { listen 800; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { #root html; #index index.html index.htm; proxy_pass http://www.baidu.com; } location /test { #root html; #index index.html index.htm; proxy_pass http://xx.xxx.xx.xx/test; } }
备注 : server 包括的内容为一套监听配置, listen 后面是端口号,location 后面为映射操作的路径地址,proxy_pass为代理转发的目标服务器地址。
// 启动nginx
systemctl start nginx
// 重新加载配置,使用新配置启动新的工作进程,优雅地关闭旧的工作进程
nginx -s reload
// 快速关闭
nginx -s stop
// 关闭
nginx -s quit