Created
July 2, 2015 04:04
-
-
Save ckeyer/d8bf98eeca42c29f11c9 to your computer and use it in GitHub Desktop.
Nginx上配置Google反向代理
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name s.ckeyer.com search.ckeyer.com; | |
location / { | |
proxy_pass https://s.ckeyer.com/; | |
} | |
} | |
server { | |
listen 443; | |
server_name s.ckeyer.com search.ckeyer.com; | |
# error_page 404 = https://dn-ckeyer-html.qbox.me/404.html; | |
# error_page 502 = https://dn-ckeyer-html.qbox.me/502.html; | |
ssl on; | |
ssl_certificate /etc/nginx/ssl/cert.pem; | |
ssl_certificate_key /etc/nginx/ssl/key.pem; | |
#ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
# ssl_protocols TLSv1 TLSv1.2; | |
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; | |
ssl_prefer_server_ciphers on; | |
ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM; | |
keepalive_timeout 70; | |
ssl_session_cache shared:SSL:10m; | |
ssl_session_timeout 10m; | |
resolver 8.8.8.8; | |
location / { | |
google on; | |
#google_scholar "scholar.google.com"; | |
google_scholar on; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://nginx.org/download/nginx-1.6.2.tar.gz | |
tar -xvf nginx-1.6.2.tar.gz | |
git clone https://github.com/cuber/ngx_http_google_filter_module | |
git clone https://github.com/yaoweibin/ngx_http_substitutions_filter_module | |
mkdir /var/tmp/nginx | |
cd nginx-1.6.2 | |
./configure \ | |
--prefix=/usr --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --lock-path=/var/lock/nginx.lock --http-client-body-temp-path=/var/tmp/nginx/client --http-proxy-temp-path=/var/tmp/nginx/proxy --http-fastcgi-temp-path=/var/tmp/nginx/fastcgi --http-scgi-temp-path=/var/tmp/nginx/scgi --http-uwsgi-temp-path=/var/tmp/nginx/uwsgi --with-http_ssl_module --with-http_gzip_static_module --with-ipv6 --with-http_sub_module \ | |
--add-module=/opt/nginx/ngx_http_google_filter_module \ | |
--add-module=/opt/nginx/ngx_http_substitutions_filter_module | |
make && make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
用这两个文件就可以傻瓜式安装吗??