Nginx Reverse proxy Google

Source: Internet
Author: User
Tags free ssl free ssl certificate ssl certificate nginx reverse proxy

Nginx reverse proxy, Google has been not easy to open, if you have a foreign VPS or server, you can easily solve this problem, this time the protagonist is Nginx,nginx reverse agent has now developed very powerful, Often take him to do load balancing, of course, this time only talk about his reverse proxy site, some people also take it to do thief program.

This time will use a nginx module, if not installed please go to the official website:

Https://github.com/yaoweibin/ngx_http_substitutions_filter_module

There are detailed installation instructions, you need to recompile the nginx.

Below the Nginx configuration, if we want to bind the domain name is Www.abc.com,google address is www.abc.com/google/

The configuration is as follows:

Location/Google {proxy_set_header Accept-encoding""; Proxy_redirect http://www.google.com/http://www.abc.com/google/;Proxy_pass http://www.google.com/;Proxy_set_header x-real-IP $remote _addr; Proxy_set_header X-forwarded-For $proxy _add_x_forwarded_for; Subs_filter'www.google.com' 'Www.abc.com/google'; Subs_filter'href= "/' 'href= "http://www.abc.com/google/'; Subs_filter'<form action= "/' '<form action= "http://www.abc.com/google/';}
 restart Nginx, visit www.abc.com/google/to Google and then post a Twitter: c#location/ Twitter {proxy_set_header accept-encoding "";p roxy_redirect Https://mobile.twitter.com/https://www.abc.com/twitter /;p roxy_pass https://mobile.twitter.com/;subs_filter mobile.twitter.com www.abc.com/twitter;subs_filter ' href= '/' Href= "https://www.abc.com/twitter/"; Subs_filter ' <form action= "/" <form action= "Https://www.abc.com/twitter /'; Subs_filter ' t.co ' www.abc.com/t.co ';} location/t.co {Proxy_pass http://t.co/;} Location/twitter {proxy_set_header accept-encoding "";p roxy_redirect https://mobile.twitter.com/https:// www.abc.com/twitter/;p roxy_pass https://mobile.twitter.com/;subs_filter mobile.twitter.com www.abc.com/twitter; Subs_filter ' href= '/' href= ' https://www.abc.com/twitter/'; Subs_filter ' <form action= '/' <form action= ' https ://www.abc.com/twitter/'; Subs_filter ' t.co ' www.abc.com/t.co ';} location/t.co {proxy_pass http://t.co/;} 

This need to open the SSL function, that is, HTTPS access, this is not difficult, I have introduced before, how to get the browser can be certified free SSL certificate.

Nginx Reverse proxy Google

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.