Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache forward proxy that handles https

I followed the example in the following SO question to successfully set up an Apache forwarding proxy: Setting up an Apache Proxy with Authentication

It works well, except that when accessing sites via https, it says it cannot find the site. For example, Chrome gives

Error 111 (net::ERR_TUNNEL_CONNECTION_FAILED): Unknown error.

And on the server, I do not even see something in the access logs. For my proxy settings, I have configured the same for http and https (i.e. port 80 on my proxy server).

Do you perhaps have an example of how to set up a forward proxy with Apache for https?

like image 857
mydoghasworms Avatar asked Jun 08 '13 19:06

mydoghasworms


People also ask

Can Apache be used as a proxy?

In addition to being a "basic" web server, and providing static and dynamic content to end-users, Apache httpd (as well as most other web servers) can also act as a reverse proxy server, also-known-as a "gateway" server.

What is forward proxy in Apache?

Apache HTTP Server can be configured in both a forward and reverse proxy (also known as gateway ) mode. An ordinary forward proxy is an intermediate server that sits between the client and the origin server.

What is Apache HTTP proxy?

Apache HTTP Proxy is a proxy service that can be used to distribute updates to client computers. Apache HTTP Proxy performs a similar role to the mirror server feature popular in ERA 5 and earlier. To install Apache HTTP Proxy, read the instructions for Windows, Linux, or Virtual Appliance.

What is the difference between ProxyPass and ProxyPassReverse?

ProxyPassReverse will intercept those headers, and rewrite them to match the Apache proxy server. ProxyPass will create a reverse proxy. A reverse proxy (or gateway), appears to the client just like an ordinary web server.


1 Answers

It seems the only thing I was missing is that I had not enabled mod_proxy_connect which was achieved with

sudo a2enmod proxy_connect

To quote the mod_proxy_connect documentation page:

This module requires the service of mod_proxy. It provides support for the CONNECT HTTP method. This method is mainly used to tunnel SSL requests through proxy servers.

like image 97
mydoghasworms Avatar answered Sep 19 '22 20:09

mydoghasworms