Total Pageviews

Monday 1 October 2012

关于在nginx webserver上安装glype的一个问题

我在自己的nginx webserver上搭建了glype,不过访问https://urdomain.com并在页面里面的Enter URL栏输入某个被封的网址,然后点击go,显示的内容为no input file specified.
页面的网址重定向到了http://urdomain.com/... .只需要把页面的网址重定向为https://urdomain.com/... 即可解决问题。具体办法:在nginx.conf里的相关server段的上面加上如下的粗体字代码,保存,然后重启nginx即可。

server {
 listen        80;
 server_name urdomain.com;
 rewrite ^ https://urdomain.com$request_uri permanent;
}

server {
 listen       443;
 server_name urdomain.com;
root   /usr/local/glype;
location / {
index  index.html index.htm index.php index.cgi;
}
location ~ \.php$ {
            root           /usr/local/glype;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME /usr/local/glype$fastcgi_script_name;
            include        fastcgi_params;
        }
ssl on;
ssl_certificate  /root/cacert.pem;
ssl_certificate_key /root/privkey.pem;
}