forked from lalamove/docker-nginx-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvhost.conf
58 lines (55 loc) · 1.72 KB
/
vhost.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
server {
listen 80 default;
server_name 127.0.0.1;
access_log /application/logs/access.log main;
charset utf-8;
include /opt/docker/etc/nginx/_http-basic-auth.conf;
# Main location
location / {
include /opt/docker/etc/nginx/_main-location-ip-rules.conf;
try_files $uri $uri/ /index.php?$query_string;
root /application/code;
index index.php;
}
location /nginx_status {
stub_status on;
}
location ^~ /(classes|library)/ {
deny all;
return 404;
}
location ~ \.php$ {
root /application/code;
fastcgi_pass php;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
include geoip_params;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;
fastcgi_busy_buffers_size 256k;
fastcgi_temp_file_write_size 256k;
fastcgi_hide_header X-Powered-By;
}
#Static files location
location ~* ^.+.(eot|ttf|woff|swf|jpg|jpeg|gif|png|ico|css|less|js)$ {
root /application/code;
rewrite ^/static1/[0-9.]+/resource/(.*) /resource/$1 last;
rewrite ^/static0/[0-9.]+/(.*)/images/(.*) /$1/images/$2 last;
access_log off;
expires 1d;
#try_files $uri @rewrite;
}
location ~ /\. { deny all; access_log off; log_not_found off; }
location ~ /\.ht { deny all; access_log off; log_not_found off; }
include /opt/docker/etc/nginx/_more.conf;
}