ixbear 发表于 2010-10-11 00:49:54

配置好SSL以后,如何使https和http的都能正常访问?

我按照网上的教程,配置好了SSL,访问https://的没事,但是访问http://的时候就会弹出来错误:


我希望httpshttp的都能正常访问网站,该怎么做呢?

我的nginx.conf文件为配置如下:server
      {
                listen       80;
                listen       443;
                server_name www.aaa.com aaa.com;
                index index.html index.htm index.php;
                root/home/wwwroot;

ssl    on;
ssl_certificate    /root/aaa.crt;
ssl_certificate_key   /root/aaa.key;
ssl_session_timeout 5m;

ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
ssl_prefer_server_ciphers   on;

                location ~ .*\.(php|php5)?$
                        {
                              fastcgi_passunix:/tmp/php-cgi.sock;
                              fastcgi_index index.php;
                              include fcgi.conf;
                              fastcgi_paramHTTPS on;
                        }

                location /status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                              expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                              expires      12h;
                        }

                log_formataccess'$remote_addr - $remote_user [$time_local] "$request" '
             '$status $body_bytes_sent "$http_referer" '
             '"$http_user_agent" $http_x_forwarded_for';
                access_log/home/wwwlogs/access.logaccess;
      }

[ 本帖最后由 ixbear 于 2010-10-12 16:42 编辑 ]

ixbear 发表于 2010-10-11 00:50:26

或者能不能强制http转到https呢

licess 发表于 2010-10-11 09:40:46

回复 1# 的帖子

/usr/local/nginx/sbin/nginx -t 看一下有错误没

单独将https的独立出为1个虚拟主机试试。

ixbear 发表于 2010-10-11 14:36:02

单独新建了一个虚拟主机,问题依旧,求解决~
页: [1]
查看完整版本: 配置好SSL以后,如何使https和http的都能正常访问?