Nginx configuration HTTPS (can support thinkphp pathinfo mode)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.