我的apache2.4configuration有问题。 我有多个服务通过Apache可达到:
www.example.com/http-service/ – >代理通行证configurationwww.example.com/webservice2/ – >代理通行证configurationwww.example.com/service3/ – >目录网页www.example.com/websock/ – >代理传递configuration
现在我想在另一个网页上:www.example.com/
但是当我想用代理传递configuration来创build位置时,当前服务不再被服务,所有请求都被redirect到 – > www.example.com
有没有解决scheme,所有的服务都可用?
<VirtualHost *:443> ServerName ServerAdmin webmaster@localhost DocumentRoot /var/www/ SSLProxyEngine on SSLProxyVerify none SSLProxyCheckPeerCN off SSLProxyCheckPeerName off SSLProxyCheckPeerExpire off SSLCertificateFile /etc/ssl/certs/www-example-com.pem SSLCertificateKeyFile /etc/ssl/private/www-example-com.key SSLCertificateChainFile /etc/ssl/certs/www-example-com.chain <Directory "/converee/"> Options FollowSymLinks AllowOverride None </Directory> <Location /http-service> Require all granted AllowOverride None ProxyPass https://localhost:5200/http-service/ ProxyPassReverse https://localhost:5200/http-service/ </Location> ProxyPass /webservice2 https://127.0.0.1:6000/ ProxyPass /websock wss://127.0.0.1:6000/websock retry=3 ProxyPassReverse /webservice2 https://127.0.0.1:6000/ ProxyPassReverse /websock wss://127.0.0.1:6000/websock retry=3 RedirectMatch permanent /webservice2$ /webservice2/ <Location /> Allow from all AllowOverride None ProxyPass http://localhost:3030/ ProxyPassReverse http://localhost:3030/ </Location> <Directory "/var/www/service3"> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny </Directory>
问候Tingle
经过一些阅读,我find了解决办法。
<LocationMatch "^(?!\/(service1|service2)\/?).*"> #Service config for / except for /service1 or service2 </LocationMatch>