server {
listen 80;
server_name www.zhanzhangbang.xyz zhanzhangbang.xyz;
rewrite ^/(.*)$ https://www.zhanzhangbang.xyz/$1 permanent;
}

server {

listen 443;
server_name www.zhanzhangbang.xyz zhanzhangbang.xyz;
index index.php index.html;
ssl on;
ssl_certificate   /var/www/zhanzhangbang/2903426_www.zhanzhangbang.xyz.pem;
ssl_certificate_key  /var/www/zhanzhangbang/2903426_www.zhanzhangbang.xyz.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;
error_log /var/log/nginx/zhanzhangbang.error.log;
access_log  /var/log/nginx/zhanzhangbang.access.log;
root /var/www/zhanzhangbang;

location ~ \.php$ {

    fastcgi_pass unix:/run/php/php7.2-fpm.sock;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

location ~* \.(ico|gif|bmp|jpg|jpeg|png|swf|js|css|mp3|mp4)$ {

    expires 3y;
    access_log off;
    gzip off;
}

location ~* \.(css|js)$ {

    access_log off;
    expires 3y;
}

location ~* \.(eot|svg|ttf|woff|woff2|otf)$ {
    add_header Access-Control-Allow-Origin *;
    expires 3y;
    access_log off;
    gzip off;
}

location ~ /\.ht {
    deny  all;
}

}

Tagged:

发表评论

电子邮件地址不会被公开。 必填项已用*标注