nginx支持ssl和panthinfo和去掉index.php

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/kongdeqian1988/article/details/77259588
server
    {
        listen 443;  #监听443端口
        #listen [::]:80;
        server_name ydyf.hynhyh.com n;
        index index.html index.htm index.php default.html default.htm default.php;
        root  /home/wwwroot/ydyf.hynhyh.com;

ssl on;
ssl_certificate   /usr/local/nginx/cert/ydyf.hynhyn.com/214228977100122.pem;
ssl_certificate_key  /usr/local/nginx/cert/ydyf.hynhyn.com/214228977100122.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;


        include none.conf;
        #error_page   404   /404.html;


        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }


        include enable-php-pathinfo.conf;   #开启支持pathinfo


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


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


        location ~ /.well-known {
            allow all;
        }


        location ~ /\.
        {
            deny all;

        }


#去掉index.php
location / {
if (!-e $request_filename) {
      rewrite  ^/(.*)$  /index.php/$1  last;
      break;
   }
}


        access_log off;
    }

猜你喜欢

转载自blog.csdn.net/kongdeqian1988/article/details/77259588
今日推荐