-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathnginx.conf
More file actions
50 lines (43 loc) · 1.22 KB
/
nginx.conf
File metadata and controls
50 lines (43 loc) · 1.22 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
server {
listen 8580;
server_name xxx.testapp.com;
set $php_upstream 'unix:/path/php-cgi.sock';
include lua/ngx_server_access.conf;
root /path/sql-profiling/public;
charset utf-8;
underscores_in_headers on;
location ~* /(\.svn|CVS|Entries){
deny all;
}
location ~* /((.*)\.(.*)\/(.*)\.php){
deny all;
}
location ~* /\.(sql|bak|inc|old)$ {
deny all;
}
location ~ \.php {
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
set $path_info $2;
}
include fastcgi_params;
fastcgi_index index.php?IF_REWRITE=1;
fastcgi_pass $php_upstream;
fastcgi_param PATH_INFO $path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $script;
try_files $uri =404;
}
location / {
index index.html index.php;
if ( -f $request_filename) {
break;
}
if ( !-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
}
}