-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.conf.template
54 lines (43 loc) · 1.62 KB
/
default.conf.template
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
# Based on https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/
# and https://github.com/rpayanm/drupal/blob/master/nginx/default
# and https://blog.john-pfeiffer.com/drupal-with-docker-compose-and-nginx-and-php-fpm-and-mariadb/
server {
include include.d/ssl.conf;
root /var/www/web;
disable_symlinks off;
client_max_body_size ${NGINX_CLIENT_MAX_BODY_SIZE};
location / {
try_files $uri /index.php?$query_string;
}
location @rewrite {
rewrite ^ /index.php;
}
location ~ \.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
include fastcgi_params;
# Block httpoxy attacks. See https://httpoxy.org/.
fastcgi_param HTTP_PROXY "";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param REMOTE_ADDR $realip_remote_addr;
fastcgi_intercept_errors on;
fastcgi_pass ${NGINX_FASTCGI_PASS_HOST}:${NGINX_FASTCGI_PASS_PORT};
# Avoid the error "upstream sent too big header while reading response
# header from upstream" by bumping fcgi buffer size.
fastcgi_buffers 16 32k;
fastcgi_buffer_size 64k;
fastcgi_busy_buffers_size 64k;
}
location ~ ^/sites/.*/files/styles/ {
try_files $uri @rewrite;
}
# Handle private files through Drupal.
location ~ ^(/[a-z\-]+)?/system/files/ {
try_files $uri /index.php?$query_string;
}
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
try_files $uri @rewrite;
expires max;
log_not_found off;
}
}