我想将 HTTPD 配置为反向代理,以仅重定向对仅包含主机名的 URL 的调用(例如:https://site1.com/),然后使用特定指令保留其他调用。 请参阅下面的一些 proxy.conf 配置作为示例:
<VirtualHost *:443>
ServerName site1.com
ErrorLog /var/log/httpd/site1.com-443-error_log
TransferLog /var/log/httpd/site1.com-443-access_log
...
<Location /wsdata>
ProxyPass https://site1.com/
ProxyPassReverse https://site1.com/
RewriteEngine on
RewriteCond %{HTTP:UPGRADE} websocket [NC]
RewriteCond %{HTTP:CONNECTION} upgrade [NC]
RewriteRule .* "wss://site1.com%{REQUEST_URI}" [P]
<Location /run>
ProxyPass https://site1.com/run/
ProxyPassReverse https://site1.com/run/?app_name=App1&page_name=Page1/
</Location>
ProxyPass / https://site1.com/
ProxyPassReverse / https://site1.com/run/?app_name=App1&page_name=Page1/
</VirtualHost>
感谢您为配置此功能提供的任何帮助。
您可以为此使用重写模块。它可以在后台使用代理模块:
RewriteEngine on
RewriteRule ^/?$ https://%{HTTP_HOST}/run/?app_name=App1&page_name=Page1/ [P,L]