【问题标题】:Apache ProxyPass not loading ResourcesApache ProxyPass 未加载资源
【发布时间】:2019-02-12 12:21:21
【问题描述】:

我配置了 apache proxypass,它正在工作,但没有加载图像、javascript、CSS 等...我想将 proxypass 传递到另一台服务器,而不是 localhost。下面是我的配置。

see error image

<VirtualHost *:80>
    ServerName app.server.com
    DocumentRoot /var/www/html/subdomain

    RewriteEngine on
    ProxyRequests Off

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    ProxyPass /apm http://192.168.1.102:9999/
    ProxyPassReverse /apm http://192.168.1.102:9999/

</virtualHost>

【问题讨论】:

标签: linux apache load-balancing reverse-proxy proxypass


【解决方案1】:

经过一些研究和阅读一些教程后,我得到了解决方案。

<VirtualHost *:80>
    ServerName app.server.com
    DocumentRoot /var/www/html/subdomain

    RewriteEngine on
    ProxyRequests Off

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    ProxyPass / http://192.168.1.102:9999/
    ProxyPassReverse / http://192.168.1.102:9999/

</VirtualHost>

【讨论】:

  • 如果您将多个服务器隐藏在 1 个代理后面,您将如何处理它,例如:/apm -> 192.168.1.102:9999 和 /abc -> 192.168.1.102:9998
  • 如果必须为多个后端服务器配置反向代理怎么办?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2017-10-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-03-13
  • 1970-01-01
相关资源
最近更新 更多