How to rewrite / proxy an Apache URI to an application listening on a specific port / server?

末鹿安然 提交于 2019-11-30 12:39:04

Using mod_proxy would work just fine. For instance, I mapped https://localhost/yalla/ to point to a subdirectory of my webserver:

LoadModule proxy_module modules/mod_proxy.so
ProxyRequests On
<Proxy *>
      Order deny,allow
      Allow from localhost
</Proxy>
ProxyPass /yalla/ http://yalla.ynfonatic.de/tmp/

If you implement this, you'll note that the pictues of the directory-listing aren't visible; this is because they're below the /tmp/ directory on the remote server, hence not visible.

So, in your case you'd do:

LoadModule proxy_module modules/mod_proxy.so
ProxyRequests On
<Proxy *>
      Order deny,allow
      Allow from localhost # Or whatever your network is if you need an ACL
</Proxy>
ProxyPass /app/ http://hostname.example.com:8080/

Like with everything in Apache configuration, watch those trailing slashes when referring to directories.

Good luck! Alex.

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