【问题标题】:Apache httpd.conf - route request to different portApache httpd.conf - 将请求路由到不同的端口
【发布时间】:2016-05-10 00:36:06
【问题描述】:

我有一个 CentOs 7.1,Apache httpd 在端口 9000 上运行。

如果我在浏览器中输入:http://192.168.56.101:9000/ 我会看到 Apache Testing 123 页面

我还有一个 GitLab 服务器在端口 8888 上运行,但该端口已被防火墙关闭。

我希望 Apache 在内部将流量重定向到 http://192.168.56.101:9000/gitlab 到 GitLab 服务器。

我已在我的 Apache 配置文件 /etc/httpd/conf/httpd.conf 中完成此操作:

<VirtualHost *:9000>
  ProxyPass /gitlab http://192.168.56.101:8888/users/sign_in
  ProxyPassReverse /gitlab http://192.168.56.101:8888/users/sign_in
</VirtualHost>

当用户浏览到http://192.168.56.101:9000/gitlab 时,会出现登录页面(虽然css 似乎坏了),但登录时会出现:

Not Found

The requested URL /users/sign_in was not found on this server.

这是否可以通过 Apache 进行配置?如果可以,如何配置?

我是否需要使用某种 Url-Rewriting,如果需要,使用哪种方法以及如何开始?

【问题讨论】:

    标签: apache url-rewriting url-redirection httpd.conf


    【解决方案1】:

    gitlab 中的所有链接都会假定您指向原始服务器。

    所以你需要查看 mod_proxy_html 来替换 HTML 中的这些链接: https://httpd.apache.org/docs/2.4/mod/mod_proxy_html.html

    【讨论】:

      猜你喜欢
      • 2015-07-24
      • 2020-04-16
      • 1970-01-01
      • 1970-01-01
      • 2015-03-24
      • 2011-11-17
      • 2013-04-09
      • 1970-01-01
      • 2020-12-28
      相关资源
      最近更新 更多