Open file: /usr/local/nginx/conf/nginx.conf put the following two similar files into the/usr/local/nginx/conf/folder 1_www.baidu.com_ bundle.crt;2_ server { listen 443; server_name www.baidu.com; #填写绑定证书的域名 ssl on; ssl_certificate 1_ Www.baidu.com_bundle.crt; ssl_certificate_key 2_ www.baidu.com.key; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #按照这个协议配置 ssl_ciphers ecdhe-rsa-aes128-gcm-sha256:high:!anull:! md5:! rc4:! DHE, #按照这个套件配置 ssl_prefer_server_ciphers on; index index.html index.htm index.php default.html default.htm default.php; root /home/wwwroot/123/; #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; location ~ .*\. (gif|jpg|jpeg|png|bmp|swf) $ { expires 30d; } location ~ .*\. (JS|CSS)?$ { expires 12h; } location ~ /.well-known { allow all; } location ~ /\. { deny all; } access_log /home/wwwlogs/beiwang.log; }
thinkphp settings in the configuration:
<?phpreturn Array (//' config item ' = = ' config value ' = ' Url_model ' + 2,);
This article is from "Punk's Technology Warehouse" blog, please make sure to keep this source http://itafei.blog.51cto.com/10862892/1975658
Nginx configuration HTTPS (can support thinkphp pathinfo mode)