Because Internet censorship, I reverse proxy facebook\twitter\youtube, can
be accessed😀, can not be login😵, can not play video😩.

Like:  www.you-tube.com.example.com -> www.youtube.com


location / {
            resolver 8.8.8.8;
            set $domain example.com;
            if ($host ~* "^(.*)-(.*).example.com$" ) {set $domains $1$2;}

            proxy_pass https://$domains;
            proxy_http_version 1.1;
            proxy_read_timeout      300;
            proxy_connect_timeout   300;
            proxy_redirect     off;
            proxy_set_header   Host            $proxy_host;
            proxy_set_header   X-Real-IP    $remote_addr;
            proxy_set_header   X-Forwarded-By     $server_addr:$server_port;
            proxy_set_header   X-Forwarded-Proto $scheme;
            proxy_set_header   X-Forwarded-For
$proxy_add_x_forwarded_for;
            proxy_set_header   Referer        $host;
            proxy_set_header   Accept-Encoding  "";

            sub_filter_once  off;
            sub_filter sub_filter_types *;
            sub_filter youtube.com you-tube.com.$domain;
            sub_filter googlevideo.com goog-levideo.com.$domain;
            sub_filter $proxy_host $host;
}

🤔🤔
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to