配置webserver:80将域名请求定向到不同的运行网络服务器:8080在同一台机器上,不同的端口?

时间:2022-01-04 02:30:00

I run Jetty6 yet gladly place Apache in the front if needs be.

我运行Jetty6但很乐意将Apache放在前面,如果需要的话。

I would like to have two webserver instances running on the same machine on different ports. I would like the instance on port 80 to redirect the second public domain name to the second webserver on port 8080.

我想在不同端口上的同一台机器上运行两个Web服务器实例。我希望端口80上的实例将第二个公共域名重定向到端口8080上的第二个Web服务器。

This should not be visible to web users.

这对Web用户不应该是可见的。

Thank you.

3 个解决方案

#1


2  

nginx setup as a proxy is a common method for doing this. It has a good reputation and I personally know of several high traffic sites using it with good results.

nginx设置作为代理是执行此操作的常用方法。它有良好的声誉,我个人知道有几个高流量网站使用它,效果很好。

The twiki has lots of info, and this proxy setup is probably similar to what you're looking for.

twiki有很多信息,这个代理设置可能与你正在寻找的类似。

#2


2  

just use the mod_proxy of apache could solve your problem

只需使用apache的mod_proxy即可解决您的问题

  ProxyRequests Off

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  ProxyPass        /  http://localhost:8080/
  ProxyPassReverse /  http://localhost:8080/

more on apache docs

更多关于apache文档

#3


1  

If I understand your question correctly, you need to enable mod_proxy in Apache, then use this line on the web server running on port 80.

如果我正确理解您的问题,您需要在Apache中启用mod_proxy,然后在端口80上运行的Web服务器上使用此行。

ProxyPassReverse / http://localhost:8080/

ProxyPassReverse / http:// localhost:8080 /

This will reverse proxy all requests to port 80 onto port 8080.

这将把所有对端口80的请求反向代理到端口8080上。

#1


2  

nginx setup as a proxy is a common method for doing this. It has a good reputation and I personally know of several high traffic sites using it with good results.

nginx设置作为代理是执行此操作的常用方法。它有良好的声誉,我个人知道有几个高流量网站使用它,效果很好。

The twiki has lots of info, and this proxy setup is probably similar to what you're looking for.

twiki有很多信息,这个代理设置可能与你正在寻找的类似。

#2


2  

just use the mod_proxy of apache could solve your problem

只需使用apache的mod_proxy即可解决您的问题

  ProxyRequests Off

  <Proxy *>
    Order deny,allow
    Allow from all
  </Proxy>

  ProxyPass        /  http://localhost:8080/
  ProxyPassReverse /  http://localhost:8080/

more on apache docs

更多关于apache文档

#3


1  

If I understand your question correctly, you need to enable mod_proxy in Apache, then use this line on the web server running on port 80.

如果我正确理解您的问题,您需要在Apache中启用mod_proxy,然后在端口80上运行的Web服务器上使用此行。

ProxyPassReverse / http://localhost:8080/

ProxyPassReverse / http:// localhost:8080 /

This will reverse proxy all requests to port 80 onto port 8080.

这将把所有对端口80的请求反向代理到端口8080上。