【发布时间】:2014-08-18 07:55:24
【问题描述】:
希望有人可以在这里帮帮我,因为这已经困扰我好几天了。
我有一个 apache 配置文件,它既可以用于标准 HTTP 服务器,也可以为网络中的页面提供反向代理。
如果我为 apache 服务器的 IP 地址创建一个新的 DNS A 记录,它会自动将请求发送到 camera1.domainname.com 虚拟主机,然后转发给我 192.168.2.160。
我想要它做的是将它发送到文件夹 /var/www/bad_url。
这里的任何建议都会很棒,因为我很确定我会开始掉头发。
NameVirtualHost *
ErrorLog ${APACHE_LOG_DIR}/error_baduri.log
CustomLog ${APACHE_LOG_DIR}/access_baduri.log combined
DocumentRoot /var/www/bad_url
ProxyPreserveHost On
ErrorLog ${APACHE_LOG_DIR}/error_cam1.log
CustomLog ${APACHE_LOG_DIR}/access_cam1.log combined
LogLevel debug
ProxyPass / http://192.168.2.160/
ProxyPassReverse / http://192.168.2.160/
ServerAlias camera1.domainname.com
ProxyPreserveHost On
ErrorLog ${APACHE_LOG_DIR}/error_mediaserver.log
CustomLog ${APACHE_LOG_DIR}/access_mediaserver.log combined
LogLevel debug
ProxyPass / http://192.168.2.207/
ProxyPassReverse / http://192.168.2.207/
ServerAlias mediaserver.domainname.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ServerAlias ubuntu1 ubuntu1.domainname.com 192.168.2.208
DocumentRoot /var/www/html
以上所有内容都在文件“etc/apache2/sites-enabled/default.conf”中。该文件夹中没有其他配置文件。
我正在运行 Ubuntu
【问题讨论】:
标签: apache apache2 virtualhost reverse-proxy