forked from unitedasian/docker-grav
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
51 lines (41 loc) · 1.54 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
error_log /dev/stdout info;
worker_processes 1;
user www-data www-data;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /dev/stdout;
sendfile on;
index index.php index.html;
server {
listen 80;
client_max_body_size 10M;
client_body_buffer_size 128k;
root /usr/share/nginx/html;
location / {
try_files $uri $uri/ /index.html;
if (!-e $request_filename){ rewrite ^(.*)$ /index.php last; }
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php5-fpm.sock;
#fastcgi_pass localhost:9000;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
## Begin - Security
# deny all direct access for these folders
location ~* /(.git|cache|bin|logs|backups)/.*$ { return 403; }
# deny running scripts inside core system folders
location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny running scripts inside user folder
location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
# deny access to specific files in the root folder
location ~ /(LICENSE|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; }
## End - Security
}
}