简体   繁体   English

Apache ProxyPass 未加载资源

[英]Apache ProxyPass not loading Resources

I configured apache proxypass and it's working but not loading images, javascript, CSS etc... I want to proxypass to another server, not localhost.我配置了 apache proxypass,它可以工作,但不能加载图像、javascript、CSS 等...我想将 proxypass 代理到另一台服务器,而不是本地主机。 Below is my configuration.下面是我的配置。

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>

After some research and reading some tutorials I got a solution.经过一些研究和阅读一些教程后,我得到了一个解决方案。

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM