我正在尝试将apache2代理设置配置为
我在/etc/apache2/sites-available/000-default.conf中有以下设置
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPreserveHost On
RewriteEngine on
ProxyPassMatch "(?<=trim=1)$" !
ProxyPassMatch "(?<!trim=1)$" "http://1.2.3.4:8080/mywebapp/"
</VirtualHost>
我可以看到带有trim = 1标志的请求也会被代理到http://1.2.3.4:8080/mywebapp/。我在regex中尝试了各种设置,比如回顾,但无法让它工作。我将不胜感激!