The root directory of the Web page would have been: 6 root/app/www/default;
1[[Email protected]default]# cat/app/server/nginx/conf/vhosts/default. conf2 server {3Listen the;4 server_name espressos.cn;5 index index.php index.htm index.html;6root/app/www/default;7Location ~. *\. (Sh|bash)?$ 8 {9 return 403;Ten } One#if(!-e $request _filename) { A# rewrite ^/(. *) $/index.php last; - # } -Location ~. *\. (PHP|PHP5)?$ the { -#fastcgi_pass unix:/tmp/php-Cgi.sock; -Fastcgi_pass127.0.0.1:9000; - Fastcgi_index index.php; + include fastcgi.conf; - } +Location ~. *\. (gif|jpg|jpeg|png|bmp|swf) $ A { at expires 30d; - } -Location ~. *\. (JS|CSS)?$ - { - expires 1h; - } ininclude/app/server/nginx/conf/rewrite/default. conf; -access_log/app/log/nginx/access/default. log; to}
Parameters: Access_log off-------> closed the log in to access logs for this page!!! The default is to log access logs.
[[Email protected]default]# tree/app/www/defaultapp/www/default/0Directories,0Files[[email protected]default]# tree/app/www/html//app/www/html/└──m.js0Directories,1File[[email protected]default]# cat/app/server/nginx/conf/rewrite/default. conf #rewrite^/index\.html/index.php last;#if(!-e $request _filename) rewrite ^/(. *) $ index.php last;#if(!-e $request _filename) {Rewrite ^/(. *) $/index.php last;}#if(!-e $request _filename) {return 404;}#if($http _user_agent ~ Firefox) {Rewrite ^ (. *)? $/nginx-firefox/$1 break;}#if($http _user_agent ~ MSIE) {Rewrite ^ (. *) $/nginx-msie/$1 break;}#rewrite^/(\d+)/(. +)//$2? id=$1Last ; #location~ ^/(cron|templates)/{deny all; Break;} #location~ ^/data {deny all;} Location^~/html/m.js {access_log off;root/app/www;expires5; Break;} #expires 5 is valid for 5 seconds!! [[Email protected]default]# tail-f/app/log/nginx/access/default. log sx.log [[email protected]default]# Tail-1/app/log/nginx/access/default. Log192.168.1.10- - [ on/aug/ .: +: A: $+0800]"get/html/%5c%22/images/upload/image/1_07 (a). Jpg%5c%22 http/1.1" 404 168 "http://192.168.1.24/html/sql.html" "mozilla/5.0 (X11; Linux x86_64; rv:45.0) gecko/20100101 firefox/45.0"
Location sets the expiration time of a file and does not log access logs