-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnginx.conf
35 lines (28 loc) · 921 Bytes
/
nginx.conf
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
server {
listen 80;
server_name localhost;
root /vagrant/public_html;
index index.php index.html index.htm;
location / {
#try_files $uri $uri/ =404;
# 这一条很重要,否则urlmanager 路由映射做不了
try_files $uri $uri/ /index.php$is_args$args;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
}