1
lazycat 2014-06-24 02:08:14 +08:00 via Android 1
301
|
2
sharpnk 2014-06-24 03:36:37 +08:00 2
你的nginx conf?
没有你的配置文件,我只能靠猜了. 但是我觉得如果你把所有到80口的请求都转到443口应该就可以了. https://gist.github.com/sharpnk/f5130d68cbc4af0adc43 |
3
KokongW 2014-06-24 10:22:16 +08:00
楼主能把nginx conf发出来吗?我也是做了一个反代,但是有些bug,想对照着修改一下。
|
4
liuchen9586 OP @KokongW @sharpnk 我把自己修改过的贴上来了 请看一下
server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; rewrite ^(.*url.*) https://ssl.okami.us$1; index index.html index.htm; } server { listen 443 ssl; server_name ssl.okami.us; ssl_certificate /usr/local/ssl/ssl_okami_us.crt; ssl_certificate_key /usr/local/ssl/ssl.okami.us.key; ssl_session_cache shared:SSL:1m; ssl_session_timeout 5m; ssl_ciphers HIGH:!aNULL:!MD5; ssl_prefer_server_ciphers on; location / { proxy_redirect off; proxy_pass https://www.google.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header Accept-Encoding ""; 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"; proxy_cookie_domain 'google.com' 'okami.us'; subs_filter 'https://www.google.com' 'https://ssl.okami.us'; subs_filter 'http://www.google.com' 'https://ssl.okami.us'; subs_filter 'href="/' 'href="https://ssl.okami.us/'; subs_filter 'onmousedown' ' '; } |
5
marklrh 2014-06-24 16:00:06 +08:00 1
server {
listen 80; listen 443 default_server ssl; server_name mmm.com; ssl_certificate /etc/nginx/ssl/xxx.crt ; ssl_certificate_key /etc/nginx/ssl/yyy.key ; if ($scheme = http) { return 301 https://$server_name$request_uri; } } 这样配置可以自动转到https |
6
9hills 2014-06-24 16:37:59 +08:00
lz的反代不错
|
7
liuchen9586 OP @9hills 请私下使用 :)
|
8
liuchen9586 OP @marklrh thanks~
|