2

I have a Raspberry Pi running Arch Linux ARM that I use as an HTTP server, with Apache/2.4.29 (Unix). Recently, I have been trying to configure this machine as a forward proxy in order to use corkscrew or proxytunnel to connect to the Internet while using my laptop behind an evil firewall. So I added a virtual server with the following configuration:

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName proxy.mydomain.com
    ErrorLog "/var/log/httpd/proxy-error_log"
    CustomLog "/var/log/httpd/proxy-access_log" common

    #SetEnv force-proxy-request-1.0 1
    #SetEnv proxy-nokeepalive 1

    ProxyRequests On
    ProxyVia Block
    AllowCONNECT 443 563 22 XYZ
    <Proxy *>
        Require ip XXX.XXX.XXX.XXX
    </Proxy>

    # The reverse proxy works, but the forward doesn't
    #ProxyPass /test https://google.it
</VirtualHost>

Besides that, I have two other virtual servers. The interesting thing is that the proxy works if it is the only virtual host enabled, but if I enable another vhost the proxy does not work anymore.

When the proxy does not work, I cannot use it with firefox (which says that the proxy is refusing connections), nor can I use it with corkscrew (which says that the proxy cannot connect to the server: method not allowed); also, in this situation the apache log file says "client denied by server configuration: /etc/httpd/htdocs". However, when I enable only the proxy virtual host, everything works, so it is not corkscrew's problem. Do someone know why? Thank you.

1 Answer 1

1

You can't match the ServerName or ServerAlias for a forward proxy.

You can have a look at sslh or sshttp, they are ssh/http(s) multiplexers, to use both protocols on the same ports.

cheers

1
  • 1
    This is really awful. If anybody finds a way around it, please update...
    – Daniel
    Sep 2, 2019 at 19:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .