Apache代理和反向代理

时间:2023-01-21 00:21:27

服务器上安装了多个服务,包括apache的80端口,以及tomcat的8080和8090,为了访问使用方便,尝试了代理和反向代理。下面是部分配置以备参考:

NameVirtualHost *:80

<VirtualHost *:80>

ServerName *

DocumentRoot /var/www/

</VirtualHost>

<VirtualHost *:80>

ServerName wiki.mydomain.cn

ProxyPreserveHost On

ProxyRequests Off

ProxyPass / http://tools.mydomain.cn:8090/

ProxyPassReverse / http://tools.mydomain.cn:8090/

ErrorLog logs/confluence_error_log

CustomLog logs/confluence_custom_log common

</VirtualHost>

<VirtualHost *:80>

ServerName tools.mydomain.cn

DocumentRoot /var/www/html/

<Directory "/var/www/html">

Options Indexes FollowSymLinks

AllowOverride None

Order allow,deny

Allow from all

</Directory>

</VirtualHost>