Hey guys! nginx reverse proxy facebook \ twitter \ youtube, can not be login

jiobxn jiobxn at gmail.com
Thu Aug 4 15:00:10 UTC 2016


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;
}

🤔🤔
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160804/5a044c1c/attachment.html>


More information about the nginx mailing list