nginx支援ssl和panthinfo和去掉index.php
阿新 • • 發佈:2018-12-11
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;
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
access_log off;
}
{
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;
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;
}
location / {
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
access_log off;
}