Apache ProxyPass not loading Resources

做~自己de王妃 提交于 2020-05-16 02:28:56

问题


I configured apache proxypass and it's working but not loading images, javascript, CSS etc... I want to proxypass to another server, not localhost. 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>

回答1:


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>



回答2:


how would you sole it if you were to hide multiple servers behind 1 proxy e.g.:

/apm -> http://192.168.1.102:9999/
/abc -> http://192.168.1.102:9998/


来源:https://stackoverflow.com/questions/52217583/apache-proxypass-not-loading-resources

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!