====== 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:
* http://example.com/app1 --> http://service1.local:8081
* http://example.com/app2 --> http://service2.local:8082
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):
* http://example.com/app1 --> http://service1.local:8081/app1
* http://example.com/app2 --> http://service2.local:8082/app2
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: [[http://www.apachetutor.org/admin/reverseproxies|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/
#
# ProxyPassReverse /
# ProxyHTMLEnable On
# ProxyHTMLURLMap http://some.app.intranet/ /my-gateway/
# ProxyHTMLURLMap / /my-gateway/
#