Table of Contents

reverse proxy

reverse proxy

ProxyRequests Off
SSLEngine On
SSLProxyEngine On

ProxyPass / https://example.com/    <-- note trailing slash!
ProxyPassReverse / https://example.com/    <-- note trailing slash!

app behind location (folder)

To achieve:

It is complicated. Needs rewriting of content body and fix all links to local resources. It is better to make 1:1 reverse proxy and configre remote service to work under location (folder):

If not possibe to reconfigure remote service server you can try to use proxy_html module which can rewrite content and fix URL mappings.

Read: Running a Reverse Proxy in Apache

a2enmod proxy_html

File /etc/apache2/mods-available/proxy_html.conf contains example:

# ProxyRequests Off  <-- this is an important security setting
# ProxyPass /my-gateway/ http://some.app.intranet/
# <Location /my-gateway/>
#       ProxyPassReverse /
#       ProxyHTMLEnable On
#       ProxyHTMLURLMap http://some.app.intranet/ /my-gateway/
#       ProxyHTMLURLMap / /my-gateway/
# </Location>