WCF 配置 Nginx 实现双机热备/负载均衡功能(Windows)

操作步骤:

1、下载 Nginx

  下载地址:http://nginx.org/en/download.html

2、安装 Nginx

  将步骤 1 中下载的安装文件(nginx-1.17.10.zip)解压到 nginx 的目标安装目录(任意目录均可)

3、配置 Nginx

  (1) 打开 nginx 的配置文件 nginx.conf;

  

   (2) 修改配置文件内容(添加 upstrem 段,修改 location 段),如下图所示:

  

4、启动 Nginx 服务

  打开 CMD,通过 cd 命令切换到 nginx 安装目录;

  通过 start nginx 命令,启动 nginx 服务;

  通过 tasklist /fi "imagename eq nginx.exe" 命令,查看服务是否启动成功(显示如下图则成功)。

  

5、使用

  启动相应的 WCF 服务;

  打开浏览器,通过 nginx 反向代理访问 WCF 服务 URL(wsdl 格式) http://172.22.113.93:8088/xxxService/?singleWsdl

  

6、常用 Nginx 命令

  start nginx       // 启动 nginx 

  nginx –s reload       // 重新加载配置文件

  nginx -s stop      // 关闭 nginx 

  

  

原文地址:https://www.cnblogs.com/dhqy/p/12924998.html