nginx.conf3
1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
server
{
listen 80;
#listen [::]:80;
server_name www.tp-shop.cn;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.tp-shop.cn;
location / {
index index.html index.htm index.php;
#autoindex on;
}
location ~ \.php(.*)$ {
fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
# 需要开启 php.ini cgi.fix_pathinfo=1
location ~.*\.(jpg|png|jpeg)$
{
root /home/wwwroot/www.tp-shop.cn;
#expires 30d;
}
# js css缓存一小时
location ~.*\.(js|css)$ {
root /home/wwwroot/www.tp-shop.cn;
#expires 1h;
}
include other.conf;
#error_page 404 /404.html;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /\.
{
deny all;
}
error_log /home/wwwlogs/www.tp-shop.cn.err;
access_log /home/wwwlogs/www.tp-shop.cn.log;
}