1. 内容概述
系统安装完成后,默认已经可以使用局域网内的IP或域名访问。如果您需要通过反向代理进行 https 方式发布产品的话,请参考本页内容。
文中以使用Nginx 1.14.2 和商业智能BI工具为例介绍反向代理过程。
2. 操作步骤
提示
使用 https 方式发布 Wyn Enterprise 需要有效的域名和 SSL证书,请您提前进行申请。
(1) 由Nginx官网(http://nginx.org/)下载Nginx压缩包并解压至Wyn Enterprise服务器的C盘根目录下。
![](https://img-blog.csdnimg.cn/img_convert/f43bddea0fecd0cafe0a5c319bac320a.png)
(2) 将SSL证书放置到服务器指定目录下,如下图所示。
![](https://img-blog.csdnimg.cn/img_convert/7c263fae5270b9763319af4c5ca3b7df.png)
(3) 打开Nginx配置文件“nginx.conf”。该文件在nginx文件包的conf子文件夹中,本例中为 C:\nginx-1.14.2\conf。
![](https://img-blog.csdnimg.cn/img_convert/7a38a433a92e20ab99ab9f23ee65aa96.png)
(4) 配置 nginx.conf 文件。请按照以下修改前后对比图修改文件中HTTPS server中的内容。
nginx.conf 配置文件修改前
![](https://img-blog.csdnimg.cn/img_convert/3eb224dd9067a792cc74e479a6bf3964.png)
nginx.conf 配置文件修改后
![](https://img-blog.csdnimg.cn/img_convert/9aa35a0da0134a113ebb744db1206ae2.png)
以下为配置文件中修改时使用的示例代码,请参考使用。
server { listen 443 ssl; server_name yourdomain.com.cn; ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; ssl_certificate C://nginx-1.14.2//ssl//00000000.pem; ssl_certificate_key C://nginx-1.14.2//ssl//000000000.key; large_client_header_buffers 4 32k; #error_page 504 //50x.html; #location = //50x.html { # root C://nginx-1.14.2//html; # internal; #} # ssl_session_cache shared:SSL:1m; # ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; location / { proxy_pass http://localhost:51980; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_connect_timeout 60s; proxy_send_timeout 60s; proxy_read_timeout 60s; send_timeout 60s; sendfile on; proxy_buffer_size 64k; proxy_buffers 32 32k; proxy_busy_buffers_size 128k; fastcgi_buffers 8 16k; fastcgi_buffer_size 32k; client_max_body_size 8M; } } server { listen 80; server_name yourdomain.com.cn; large_client_header_buffers 4 32k; return 301 https://$host$request_uri; } |
(5) 保存配置文件后,双击 nginx.exe 文件运行 Nginx。
![](https://img-blog.csdnimg.cn/img_convert/e48ffa97881c77a3dba083fcc72c3ba3.png)
提示
因为HTTPS默认使用443端口,所以需要添加入站规则,允许远程访问443端口。
有关开启端口的介绍,请参见如何设置防火墙规则(开放端口)。
![](https://img-blog.csdnimg.cn/img_convert/a8fb4b70077eba5ef83b7eea3dab56be.png)
3. 部署为子应用程序
如需将Wyn Enterprise 部署为子程序,另外还需更改Wyn 的配置文件,添加子应用程序名。
该文件的位置默认为“C:\Program Files\Wyn Enterprise\Monitor\conf”
提示
![](https://img-blog.csdnimg.cn/img_convert/6488dda0e355cc305b89810a314608a9.png)
修改配置文件,添加如下图所示的“PathBase”,指定子应用程序名称。
![](https://img-blog.csdnimg.cn/img_convert/05cbd7e8662a113f667d21338eed81c4.png)
配置文件修改完成后,重启WynService服务。
![](https://img-blog.csdnimg.cn/img_convert/f97645a33b8788be99c82869781c3bbe.png)
之后就可以使用反向代理中配置的域名加上在Wyn.conf 中配置的子应用程序名称来访问站点。