0

I need some help on using the reverse proxy in apache. what i want to achieve is that suppose my apache webserver intercepts requests like.

https://myweb-application1-secret.domain1.com/webcontextroot and i want to use the particular url of my choice to mask some important information in above URL

e.g i want to use the new URL as

https://myweb-application1-normal.domain2.com/webcontextroot

how can i achieve this.

  • Have you looked at this question about Apache mod_rewrite? https://serverfault.com/questions/214512/redirect-change-urls-or-redirect-http-to-https-in-apache-everything-you-ever – Mike Marseglia Dec 10 '18 at 13:02

1 Answers1

0

Setup a dns address myweb-application1-normal.domain2.com to point to your Apache server's IP. Configure an Apache virtualhost with the directive

<Virtualhost *:443>
ServerName myweb-application1-normal.domain2.com

ProxyPass / https://myweb-application1-secret.domain1.com/
ProxyPassReverse / https://myweb-application1-secret.domain1.com/webcontextroot
</VirtualHost>

This tells Apache to respond to requests at host name myweb-application1 and proxies them to the secret URL. Note that the secret URL still has to be resolvable. It's just hidden from the user. You should restrict users from accessing it directly using allow/deny directives.

Mike Marseglia
  • 883
  • 7
  • 18
Iyad K
  • 111
  • 3