我有一个vhost配置,我想要创建2代理,第一个代理传递必须将所有调用重定向到http://localhost:3333,但我想要排除myhost.localhot / myforlder。 myfolder是一个“Alias”
myhost.localhost
<VirtualHost *:80>
ServerAdmin myhost.localhost
ServerName myhost.localhost
ServerAlias www.myhost.localhost
DocumentRoot C:/wamp/www/myhost/
DirectoryIndex index.php index.html index.htm
RewriteEngine On
#this a alias for get correct file index.html
#work fine only if i remove next proxyPass
Alias "/myfolder " "C:/wamp/www/myfolder/theme"
#all calls proxy
ProxyPass / http://localhost:3333/
<Directory />
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
# Ricordarsi di creare la directory
ErrorLog C:/wamp/logs/myhost.localhost.error.log
CustomLog C:/wamp/logs/myhost.localhost.access.log combined
</VirtualHost>
使用此配置,如果我调用http://myhost.localhost/examples工作,但如果我调用myhost.localhot / myforlder,则呼叫在服务器端口3333。
如何从proxyPass指令中排除myfolder?
答案 0 :(得分:0)
您可以在apache中从mod_proxy中排除路径,在末尾添加感叹号(!)。
ProxyPass /my/excluded/path !
此行必须在之前添加:
#all calls proxy
ProxyPass / http://localhost:3333/