首页 > 代码库 > https和http共存的nginx配置

https和http共存的nginx配置


server {
        listen       80;
        listen      443 ssl;
        server_name  test.xx.com;
        index index.html index.htm index.php;
        root /usr/local/default;
        location ~ .*\.(php|php5)?$
        {
                #fastcgi_pass  unix:/tmp/php-cgi.sock;
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi.conf;
        }
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
        {
                #expires 30d;
        }
        location ~ .*\.(js|css)?$
        {
                #expires 1h;
        }
       
        access_log  logs/test.access.log;
        ssl_certificate /x.com_bundle.crt;
        ssl_certificate_key /x.com.key;
        ssl_session_timeout  5m;
        ssl_protocols  TLSv1 TLSv1.1 TLSv1.2;
        ssl_ciphers AESGCM:ALL:!DH:!EXPORT:!RC4:+HIGH:!MEDIUM:!LOW:!aNULL:!eNULL;
        ssl_prefer_server_ciphers   on;
}

https和http共存的nginx配置