Apache ProxyPass and redirects
by SlackCoder from LinuxQuestions.org on (#5JA4M)
Hi,
Any knowledgeable Apache users here? I am having trouble with a virtual host setup to proxy to and from a locally running application hosted on a different internal port. Everything is fine until the application tries to redirect to an external domain.
When, for example, the application tries to redirect to some.otherhost.com/page.html it is instead redirected to some.host.com/page.html where some.host.com is the application's virtual host. Any ideas?
thanks
```
<VirtualHost _default_:443>
ServerName some.host.com
<location />
ProxyPreserveHost On
ProxyPass http://127.0.0.1:8080/
ProxyPassReverse /
RequestHeader add "X-Forwarded-Proto" "https"
</location>
...
</VirtualHost>
```


Any knowledgeable Apache users here? I am having trouble with a virtual host setup to proxy to and from a locally running application hosted on a different internal port. Everything is fine until the application tries to redirect to an external domain.
When, for example, the application tries to redirect to some.otherhost.com/page.html it is instead redirected to some.host.com/page.html where some.host.com is the application's virtual host. Any ideas?
thanks
```
<VirtualHost _default_:443>
ServerName some.host.com
<location />
ProxyPreserveHost On
ProxyPass http://127.0.0.1:8080/
ProxyPassReverse /
RequestHeader add "X-Forwarded-Proto" "https"
</location>
...
</VirtualHost>
```