自动跳转http://www.veryyx.com nginx配置


server {
     listen 80;
     server_name www.abcd.com  abcd.com;   
     rewrite ^(.*)$ https://$host$1 permanent;
     location / {
        index index.html index.htm;
        }
}
 
server {
        listen       443 ssl;
        server_name  www.veryyx.cn  abcd.com;
        #ssl on;
        ssl_certificate      /usr/local/nginx/conf/3749980_www.abcd.com_nginx/3749980_www.abcd.com.pem;
        ssl_certificate_key  /usr/local/nginx/conf/3749980_www.abcd.com_nginx/3749980_www.abcd.com.key;
        ssl_session_timeout  5m;
        ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
        ssl_prefer_server_ciphers   on;
        
        if ($http_host !~ '^www\.abcd\.com$') {
            rewrite ^(.*) https://www.abcd.com$1 redirect;
        } 
 
        root /home/www/wwwroot/abcd/public;
        index index.html index.htm index.php;
        include enable-php.conf;
 
        location / {
                #try_files $uri $uri/ /index.php?$query_string;
                try_files $uri $uri/ /index.php$is_args$query_string;
        }
    access_log /home/www/wwwlogs/abcd.log;

————————————————