1
votes

I'm trying to setup reverse proxy to some web service, so I can develop JavaScript Ajax application on localhost. I have managed to do it with Apache following way:

ProxyPass /serviceproxy/ http://someservice.com/
ProxyPassReverse /serviceproxy/ http://someservice.com/
ProxyHTMLURLMap http://someservice.com/  /serviceproxy/

<Location /serviceproxy>
       ProxyPassReverse        /
       ProxyHTMLEnable On
       ProxyHTMLURLMap         / /serviceproxy/
       ProxyHTMLURLMap         http://someservice.com/
       RequestHeader    unset  Accept-Encoding
</Location>

That works fine for http webpages, but not for https pages. If I set proxy to https://someservice.com/, Apache returns 500 Internal server error. I'm new to Apache configuration. How to make it work? Is it even possible?

thanks

1

1 Answers

0
votes

You have to enable Ssl module (a2enmod ssl) Then in /etc/apache2/sites-available/default file include following lines

RequestHeader set X-Forwarded-Proto "https"
ServerName localhost
SSLProxyEngine On
RequestHeader set Front-End-Https "On"

Between line

ServerAdmin webmaster@localhost

and line

DocumentRoot /var/www

Hope it helps.