Files
nginx/auto
Roman Arutyunyan 8599df49d6 HTTP tunnel module
The module handles CONNECT requests and establishes a tunnel to a
backend.

Example config:

http {

    map $request_port $allow_port {
        80             1;
        443            1;
    }

    map $host $allow_host {
        hostnames;

        example.com    1;
        *.example.org  1;
    }

    server {
        listen 8000;

        resolver dns.example.com;

        if ($allow_port != 1) {
            return 403;
        }

        if ($allow_host != 1) {
            return 403;
        }

        tunnel_pass;
    }
}

Request:

    $ curl -x 127.0.0.1:8000 https://example.com
2026-05-08 09:42:58 +04:00
..
2012-01-18 15:07:43 +00:00
2012-01-18 15:07:43 +00:00
2012-01-18 15:07:43 +00:00
2012-01-18 15:07:43 +00:00
2021-09-21 14:46:25 +03:00
2026-05-08 09:42:58 +04:00
2012-01-18 15:07:43 +00:00
2026-05-08 09:42:58 +04:00
2022-01-25 15:41:48 +03:00
2012-01-18 15:07:43 +00:00
2021-12-25 01:07:15 +03:00