需要帮助设置:Apache 反向代理
我在以正确的方式设置虚拟主机文件时遇到一些问题。 我想通过使用反向代理将访客发送到正确的服务器。 我当前的设置给了我一个内部错误。
我只有 1 个公共 IP,并且希望在本地虚拟服务器之一的正确服务器名的情况下将访问者代理。
NameVirtualHost *:80
<VirtualHost *:80>
ServerName sub.domain.com
ServerAdmin [email protected]
ProxyPreserveHost On
ProxyPass / http://192.168.1.11:80
ProxyPassReverse / http://192.168.1.11:80
</VirtualHost>
<VirtualHost *:80>
ServerName otherdomain.com
ServerAdmin [email protected]
ProxyPreserveHost On
ProxyPass / http://192.168.1.12:80
ProxyPassReverse / http://192.168.1.12:80
</VirtualHost>
如果有人能发现我做错了什么,或者有其他方法来实现我的目标,我很乐意听到。
I have some trouble setting my virtualhosts file up the right way.
I'd like to send vistors to the right server by using reverse proxy.
My current setup gives me an internal error.
i have only 1 public ip and want to proxy the visitor on the condition of the right servername to one of the local virtual servers.
NameVirtualHost *:80
<VirtualHost *:80>
ServerName sub.domain.com
ServerAdmin [email protected]
ProxyPreserveHost On
ProxyPass / http://192.168.1.11:80
ProxyPassReverse / http://192.168.1.11:80
</VirtualHost>
<VirtualHost *:80>
ServerName otherdomain.com
ServerAdmin [email protected]
ProxyPreserveHost On
ProxyPass / http://192.168.1.12:80
ProxyPassReverse / http://192.168.1.12:80
</VirtualHost>
If someone can find anything I'm doing wrong or has another way to achieve my goal i'd love to hear so..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
成功了!使用以下设置:
/websvn/ 部分需要正确包含 css 和其他文件
在另一个加载的 .conf 文件中:
用于包含必要的模块
Got it working! used the following setup:
the /websvn/ part was neccesary to include the css and other files properly
In another loaded .conf file:
Which is used to inlcude the neccesary modules