For some reasons I need to access https://api.postcodeapi.nu/ with http instead of https. I have created a reverse proxy in my Apache:
<VirtualHost 127.0.0.1:80> ServerName api.postcodeapi.nu.local SSLProxyEngine on ProxyPass / https://api.postcodeapi.nu/ ProxyPassReverse / https://api.postcodeapi.nu/ </VirtualHost>
Added following line in /etc/hosts
and accessing with curl but get Bad gateway:
# curl http://api.postcodeapi.nu.local <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>502 Bad Gateway</title> </head><body> <h1>Bad Gateway</h1> <p>The proxy server received an invalid response from an upstream server.<br /> </p> </body></html>
Can someone please help me?