forked from altsalt/civicrm-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
civicrm.conf
97 lines (79 loc) · 2.16 KB
/
civicrm.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
server {
listen 80; ## listen for ipv4
listen [::]:80 default ipv6only=on; ## listen for ipv6
root /var/www/html;
index index.php index.html index.htm;
# Uncomment to make site accessible from http://localhost
#server_name localhost;
# Disable sendfile - https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
sendfile off;
# Let Docker handle logs
error_log /dev/stdout info;
access_log /dev/stdout;
# Allow favicon.ico
location = /favicon.ico {
log_not_found off;
access_log off;
}
# Allow robots.txt
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Allow "Well-Known URIs" as per RFC 5785
location ~* ^/.well-known/ {
allow all;
}
# Emulate .htaccess
location ~* ^/sites/.*/files/civicrm/(?:ConfigAndLog|custom|upload|templates_c) {
access_log off;
return 404;
}
# Deny access to dotfiles
location ~ (^|/)\. {
return 403;
}
# Deny access to vendor files
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
# Deny access to private files
location ~ ^/sites/.*/private/ {
return 403;
}
# Deny access to parent files
location ~ \..*/.*\.php$ {
return 403;
}
# Restrict access outside of LAN
location ~* \.(txt|log)$ {
allow 192.168.0.0/16;
deny all;
}
# Attempt to serve as file, then directory, then fall back
location / {
try_files $uri $uri/ /index.php?q=$uri$args /index.php?$args;
}
# Pass PHP scripts to FastCGI running on app container
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass app:9000;
fastcgi_index index.php;
}
# Set expiration on static content
location ~* \.(css|gif|jpeg|jpg|js|ico|png|xml)$ {
expires 7d;
log_not_found off;
}
}