-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnginx_machete.conf
63 lines (50 loc) · 1.35 KB
/
nginx_machete.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# machete
server {
listen 80;
server_name _;
#charset UTF-8;
#access_log logs/machete.access.log main;
client_max_body_size 20m;
root /var/www/machete/www;
index index.php index.html;
location ~ .*\/([^\/]*\.(gif|jpg|jpeg|png|webp|bmp|swf|js|css|ico|mp4|mov|mp3|ts)) {
# support file download
if ($arg_download) {
add_header Content-disposition "attachment; filename=$1";
}
expires 30d;
}
gzip on;
gzip_comp_level 4;
gzip_types text/css text/xml application/x-javascript application/atom+xml application/rss+xml application/x-shockwave-flash;
location / {
try_files $uri $uri/ /index.php?$args;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ ^/index\.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/machete/www$fastcgi_script_name;
include fastcgi_params;
}
# deny all other php
location ~ \.php {
deny all;
}
# deny all md
location ~ \.md {
deny all;
}
# deny all txt
location ~ \.txt {
deny all;
}
# deny all url
location ~ \.url {
deny all;
}
# deny all hidden files
location ~ /\. {
deny all;
}
}