【发布时间】:2021-10-12 21:47:59
【问题描述】:
我在使用端口 8090 的 Windows 服务器上安装了一个应用程序,我使用 IIS 应用了反向代理配置以使该应用程序在端口 443 上可用
然而,我曾经在使用 web 应用程序时遇到过问题,当我联系开发人员时,他们建议我在 windows 上使用 apache 服务器并应用以下配置:
<VirtualHost *:443>
ServerName demo.somwthing.com
SSLEngine On
SSLProxyEngine On
SSLCertificateFile ""
SSLCertificateKeyFile ""
SSLCertificateChainFile ""
#LogLevel debug mod_rewrite.so:debug
#LogLevel trace5
ErrorLog C:\Server\Apache\Apache24\logs\report.txt
CustomLog C:\Server\Apache\Apache24\logs\custom.txt \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
ProxyRequests Off
ProxyPreserveHost On
ProxyPass /.well-known !
<Location /event-stream>
Require all granted
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule .* ws://192.168.11.132:8090%{REQUEST_URI} [P]
</Location>
<Location /system-event-stream>
Require all granted
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule .* ws://192.168.11.132:8090%{REQUEST_URI} [P]
</Location>
<Location /dashboard-event-stream>
Require all granted
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule .* ws://192.168.11.132:8090%{REQUEST_URI} [P]
</Location>
ProxyPass / http://192.168.1.132:8090/
ProxyPassReverse / http://192.168.1.132:8090/
</VirtualHost>
我无法在 Windows 上成功运行 apache,我们仍然更喜欢 IIS,现在我能够在 IIS 中应用重写规则和条件,但我仍然不知道如何将标签转换为IIS,之前配置中的location标签和Match URL一样吗? 请帮助我了解位置标记及其在此配置中的作用以及如何在 IIS 中反映它
谢谢
【问题讨论】:
-
删除了 apache 标签,因为这是一个 IIS 问题,您“只是”用它来描述您的目标。这个问题与 Apache httpd 无关。
标签: iis url-rewriting reverse-proxy windows-server-2019