本帖最后由 13663010754 于 2016-4-16 12:51 编辑
nginx设置的不记录png等日志,不生效;去掉域名重定向后生效,他们有冲突?
[root@66 conf]# vim vhosts/asyou.conf
1 server
2
3 {
4 listen 80 ;
5 #listen 80 default_server;
6 server_name asyou.cn test.com ;
7 index index.html index.htm index.php;
8 root /data/www/;
9
10 access_log /tmp/asyoou.cn.access.log guanlog;
11 #域名重定向
12 # if ( $host != 'asyou.cn' ){
13 # rewrite ^/(.*)$ http://asyou.cn/$1 permanent;
14 # }
15
16 location ~ .*admin\.php$ {
17 auth_basic "Auth";
18 auth_basic_user_file /data/htpasswd;
19
20 include fastcgi_params;
21 fastcgi_pass unix:/tmp/php-fcgi.sock;
22 fastcgi_index index.php;
23 fastcgi_param SCRIPT_FILENAME /data/www/$fastcgi_script_name;
24 }
25 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
26 {
27 access_log off;
28 }
29 location ~ .*\.(css|js)
30 {
31 access_log off;
32 }
33 location ~ static
34 {
35 access_log off;
36 }
37 location ~ /astt/ {
38 auth_basic "Auth";
39 auth_basic_user_file /data/htpasswd;
40
41 include fastcgi_params;
42 fastcgi_pass unix:/tmp/php-fcgi.sock;
43 fastcgi_index index.php;
44 fastcgi_param SCRIPT_FILENAME /data/www/$fastcgi_script_name;
45 }
46 location ~ \.php$ {
47 include fastcgi_params;
48 fastcgi_pass unix:/tmp/php-fcgi.sock;
49 # fastcgi_pass 127.0.0.1:9000;
50
51 fastcgi_index index.php;
52 fastcgi_param SCRIPT_FILENAME /data/www/$fastcgi_script_name;
53 }
54 }
nginx设置的不记录png等日志,不生效;去掉域名重定向后生效,他们有冲突?
[root@66 conf]# vim vhosts/asyou.conf
1 server
2
3 {
4 listen 80 ;
5 #listen 80 default_server;
6 server_name asyou.cn test.com ;
7 index index.html index.htm index.php;
8 root /data/www/;
9
10 access_log /tmp/asyoou.cn.access.log guanlog;
11 #域名重定向
12 # if ( $host != 'asyou.cn' ){
13 # rewrite ^/(.*)$ http://asyou.cn/$1 permanent;
14 # }
15
16 location ~ .*admin\.php$ {
17 auth_basic "Auth";
18 auth_basic_user_file /data/htpasswd;
19
20 include fastcgi_params;
21 fastcgi_pass unix:/tmp/php-fcgi.sock;
22 fastcgi_index index.php;
23 fastcgi_param SCRIPT_FILENAME /data/www/$fastcgi_script_name;
24 }
25 location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
26 {
27 access_log off;
28 }
29 location ~ .*\.(css|js)
30 {
31 access_log off;
32 }
33 location ~ static
34 {
35 access_log off;
36 }
37 location ~ /astt/ {
38 auth_basic "Auth";
39 auth_basic_user_file /data/htpasswd;
40
41 include fastcgi_params;
42 fastcgi_pass unix:/tmp/php-fcgi.sock;
43 fastcgi_index index.php;
44 fastcgi_param SCRIPT_FILENAME /data/www/$fastcgi_script_name;
45 }
46 location ~ \.php$ {
47 include fastcgi_params;
48 fastcgi_pass unix:/tmp/php-fcgi.sock;
49 # fastcgi_pass 127.0.0.1:9000;
50
51 fastcgi_index index.php;
52 fastcgi_param SCRIPT_FILENAME /data/www/$fastcgi_script_name;
53 }
54 }
编辑回复