forked from psi-4ward/docker-php-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
61 lines (50 loc) · 1.32 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
52
53
54
55
56
57
58
59
60
61
# run nginx in foreground
daemon off;
error_log /data/logs/nginx/nginx-error.log warn;
pid /var/run/nginx.pid;
worker_processes 5;
events {
worker_connections 1024;
}
http {
sendfile on;
include /etc/nginx/mime.types;
include /etc/nginx/fastcgi.conf;
default_type application/octet-stream;
tcp_nopush on;
client_body_temp_path /tmp/nginx/body 1 2;
fastcgi_temp_path /tmp/nginx/fastcgi_temp 1 2;
client_max_body_size 2G;
server {
#listen [::]:80; #uncomment for IPv6 support
listen 80;
root /data/htdocs;
index index.php index.html index.htm;
disable_symlinks off;
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# deny dot-files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
location / {
try_files $uri $uri/ /index.html;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}