Easy hurdles with Openshift+nginx proxy Google

Source: Internet
Author: User

For well-known reasons, accessing Google in China requires hurdles. But every search to start hurdles software is a bit inconvenient. Here is a way to use Openshift to Hurdle. The first is:

Clicking on the search results will jump out of the proxy:


Preparation space: Create a DIY project in the WEB CONSOLE and log in to the background using SSH .

Second, compile Nginx: wget down from the nginx.org ,tar zxvf unpacking, while preparing ngx_cache_purge and Pcre, with nginx in the $OPENSHIFT _data_dir , unpack and compile.

Third, configure the agent: Edit conf/nginx.conf, my configuration document is as follows:

#user nobody;worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid;events {worker_connections 1024;} HTTP {include mime.types; Default_type application/octet-stream; #log_format main ' $remote _addr-$remote _user [$time _lo Cal] "$request" ' # ' $status $body _bytes_sent "$http _referer" ' # ' "$http _user_agent" "$http _x_forwarded_for"; #access_log Logs/access.log Main; Port_in_redirect off; Sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout; #A #gzip on; Upstream Google {server max_fails=3; server max_fails=3; server ma x_fails=3; Server max_fails=3; Server max_fails=3;} server {listen; server_name localhost; #server_name google-i51.rhcloud.com; #rewrite ^ (. *) https:// Xxx.rhcloud.com$1 permanent; #charset Koi8-r; #access_log Logs/host.access.log Main; #location/{# root HTML; # Index index.HTML index.htm;#} #error_page 404/404.html; # REDIRECT Server error pages to the static page/50x.html# #error_page 502 503 504/50x.html; Location/{#proxy_cache one; #proxy_cache_valid 302 1h; #proxy_cache_valid 404 1m; Proxy_redirect https://www.google . com//; Proxy_cookie_domain google.com XXX.rhcloud.com; Proxy_pass http://www.google.com; Proxy_set_header Host "www.google.com"; Proxy_set_header accept-encoding "UTF-8"; Proxy_set_header user-agent $http _user_agent; #proxy_set_header accept-language "ZH-CN"; #proxy_set_header Cookie "pref=id=047808f19f6de346:u=0f62f33dd8549d11:ff=2:ld=zh-cn:nw=1:tm=1325338577:lm= 1332142444:gm=1:sg=2:s=re0syjh2w1iq-maw "; Sub_filter "www.google.com" "XXX.rhcloud.com"; Sub_filter_once off;}}}

whereXXX.rhcloud.com please replace yourself with your address.

Four, the finished: Perform Sbin/nginx to test, if not run, according to the log debugging. If it works, you can add it to your startup, and you won't have to repeat it here.

Easy hurdles with Openshift+nginx 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.