-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdrupal.conf
49 lines (39 loc) · 1.31 KB
/
drupal.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
#drupal config
server {
listen 80;
server_name example.com; ###change
access_log /path_to_example_com_log/access.log; ###change
error_log /path_to_example_com_log/error.log; ###change
root /path_to_drupal_root; ###change
index index.php;
gzip on; #optional
charset utf-8;
error_page 404 index.php;
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php?q=$1 last;
}
# hide protected files
location ~* .(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(.php)?|xtmpl)$|^(code-style.pl|Entries.*|Repository|Root|Tag|Template)$ {
deny all;
}
# hide backup_migrate files
location ~* files/backup_migrate { ##change
deny all;
}
#hide vcs dir
location ~ (/.svn/)|(^/.git/) { #TODO other vcs dir
deny all;
}
# serve static files directly
location ~* ^.+\.(jpg|jpeg|gif|png|ico|mp3|css|zip|tgz|gz|rar|bz2|doc|docx|xls|xlsx|exe|pdf|dat|avi|ppt|txt|tar|mid|midi|wav|bmp|rtf|wmv|mpeg|mpg|tbz|js|swf|flv)$ {
root /path_to_root_static_files; ###change
expires 30d;
access_log off;
}
location ~ .php$ {
include fastcgi_params
fastcgi_pass 127.0.0.1:9000; ###change
#fastcgi_pass unix:/var/run/php-fcgi.sock; ###socket
fastcgi_index index.php;
}
}