From 900c9992709433c8f4f819ca0ae345fa0d597e6e Mon Sep 17 00:00:00 2001 From: Rhilip Date: Wed, 29 May 2019 19:27:51 +0800 Subject: [PATCH] docs(Migration): Update Nginx config --- migration/ridpt.nginx.conf | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/migration/ridpt.nginx.conf b/migration/ridpt.nginx.conf index 76b34f0..8846096 100644 --- a/migration/ridpt.nginx.conf +++ b/migration/ridpt.nginx.conf @@ -2,15 +2,18 @@ server { listen 80; #listen [::]:80; - server_name ridpt.rhilip.info ; + server_name ridpt.top ridpt.rhilip.info; index index.html index.htm index.php default.html default.htm default.php; - root /data/wwwroot/ridpt.rhilip.info/apps/public/; + root /data/wwwroot/ridpt.top/apps/public/; #error_page 404 /404.html; # Deny access to PHP files in specific directory location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; } + # Don't Log the access log of robots.txt + location = /robots.txt { allow all; log_not_found off; access_log off; } + location = / { rewrite ^(.*)$ /index last; } @@ -27,24 +30,23 @@ server } } - location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ - { - expires 30d; + location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ { + expires 30d; + access_log off; } - location ~ .*\.(js|css)?$ - { - expires 12h; + location ~ .*\.(js|css)?$ { + expires 7d; + access_log off; } location ~ /.well-known { allow all; } - location ~ /\. - { + location ~ /\.ht { deny all; } - access_log /data/wwwlogs/ridpt.rhilip.info.log; + access_log /data/wwwlogs/ridpt.top.log; }