Skip to content

Commit a9928b3

Browse files
dannylambNigel Banks
authored andcommitted
_all_ the timeouts
1 parent a65eb49 commit a9928b3

File tree

17 files changed

+125
-10
lines changed

17 files changed

+125
-10
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[template]
2+
src = "default.conf.tmpl"
3+
dest = "/etc/nginx/http.d/default.conf"
4+
uid = 100
5+
gid = 101
6+
mode = "0644"
7+
keys = [ "/" ]

crayfish/rootfs/etc/nginx/http.d/default.conf renamed to crayfish/rootfs/etc/confd/templates/default.conf.tmpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ server {
1515

1616
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
1717
fastcgi_param DOCUMENT_ROOT $realpath_root;
18+
19+
fastcgi_read_timeout {{ getenv "NGINX_FASTCGI_READ_TIMEOUT" }};
20+
fastcgi_send_timeout {{ getenv "NGINX_FASTCGI_SEND_TIMEOUT" }};
21+
fastcgi_connect_timeout {{ getenv "NGINX_FASTCGI_CONNECT_TIMEOUT" }};
22+
proxy_read_timeout {{ getenv "NGINX_PROXY_READ_TIMEOUT" }};
23+
proxy_send_timeout {{ getenv "NGINX_PROXY_SEND_TIMEOUT" }};
24+
proxy_connect_timeout {{ getenv "NGINX_PROXY_CONNECT_TIMEOUT" }};
25+
send_timeout {{ getenv "NGINX_SEND_TIMEOUT" }};
26+
keepalive_timeout {{ getenv "NGINX_KEEPALIVE_TIMEOUT" }};
27+
client_body_timeout {{ getenv "NGINX_CLIENT_BODY_TIMEOUT" }};
28+
lingering_timeout {{ getenv "NGINX_LINGERING_TIMEOUT" }};
29+
1830
# Prevents URIs that include the front controller. This will 404:
1931
# http://domain.tld/index.php/some-path
2032
# Remove the internal directive to allow URIs like this

demo/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,6 @@ RUN --mount=type=cache,id=demo-composer,sharing=locked,target=/root/.composer/ca
5858
mkdir -p /var/www/drupal/web/sites/default/files/library-definitions && \
5959
cp /var/www/drupal/web/modules/contrib/openseadragon/openseadragon.json /var/www/drupal/web/sites/default/files/library-definitions
6060

61-
FROM ${repository}/drupal:${tag}
61+
FROM ${repository}/drupal:${tag} AS drupal
6262

6363
COPY --from=composer --chown=nginx:nginx /var/www /var/www
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[template]
2+
src = "drupal.fpm.conf.tmpl"
3+
dest = "/etc/nginx/shared/drupal.fpm.conf"
4+
uid = 100
5+
gid = 101
6+
mode = "0644"
7+
keys = [ "/" ]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# In Drupal 8, we must also match new paths where the '.php' appears in
2+
# the middle, such as update.php/selection. The rule we use is strict,
3+
# and only allows this pattern with the update.php front controller.
4+
# This allows legacy path aliases in the form of
5+
# blog/index.php/legacy-path to continue to route to Drupal nodes. If
6+
# you do not have any paths like that, then you might prefer to use a
7+
# laxer rule, such as:
8+
# location ~ \.php(/|$) {
9+
# The laxer rule will continue to work if Drupal uses this new URL
10+
# pattern with front controllers other than update.php in a future
11+
# release.
12+
location ~ '\.php$|^/update.php' {
13+
fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
14+
# Ensure the php file exists. Mitigates CVE-2019-11043
15+
try_files $fastcgi_script_name =404;
16+
# Security note: If you're running a version of PHP older than the
17+
# latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini.
18+
# See http://serverfault.com/q/627903/94922 for details.
19+
include fastcgi_params;
20+
# Block httpoxy attacks. See https://httpoxy.org/.
21+
fastcgi_param HTTP_PROXY "";
22+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
23+
fastcgi_param PATH_INFO $fastcgi_path_info;
24+
fastcgi_param QUERY_STRING $query_string;
25+
fastcgi_param HTTPS on;
26+
fastcgi_param HTTP_SCHEME https;
27+
fastcgi_intercept_errors on;
28+
fastcgi_buffers 16 16k;
29+
fastcgi_buffer_size 32k;
30+
# PHP 7 socket location.
31+
fastcgi_pass unix:/var/run/php-fpm7/php-fpm7.sock;
32+
33+
# _ALL_ the timeouts
34+
fastcgi_read_timeout {{ getenv "NGINX_FASTCGI_READ_TIMEOUT" }};
35+
fastcgi_send_timeout {{ getenv "NGINX_FASTCGI_SEND_TIMEOUT" }};
36+
fastcgi_connect_timeout {{ getenv "NGINX_FASTCGI_CONNECT_TIMEOUT" }};
37+
proxy_read_timeout {{ getenv "NGINX_PROXY_READ_TIMEOUT" }};
38+
proxy_send_timeout {{ getenv "NGINX_PROXY_SEND_TIMEOUT" }};
39+
proxy_connect_timeout {{ getenv "NGINX_PROXY_CONNECT_TIMEOUT" }};
40+
send_timeout {{ getenv "NGINX_SEND_TIMEOUT" }};
41+
keepalive_timeout {{ getenv "NGINX_KEEPALIVE_TIMEOUT" }};
42+
client_body_timeout {{ getenv "NGINX_CLIENT_BODY_TIMEOUT" }};
43+
lingering_timeout {{ getenv "NGINX_LINGERING_TIMEOUT" }};
44+
}

drupal/rootfs/etc/nginx/shared/drupal.fpm.conf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,14 @@ location ~ '\.php$|^/update.php' {
2929
fastcgi_buffer_size 32k;
3030
# PHP 7 socket location.
3131
fastcgi_pass unix:/var/run/php-fpm7/php-fpm7.sock;
32+
fastcgi_read_timeout 3600;
33+
fastcgi_send_timeout 3600;
34+
fastcgi_connect_timeout 3600;
35+
proxy_read_timeout 3600;
36+
proxy_send_timeout 3600;
37+
proxy_connect_timeout 3600;
38+
send_timeout 3600;
39+
keepalive_timeout 3600;
40+
client_body_timeout 3600;
41+
lingering_timeout 3600;
3242
}

homarus/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ RUN --mount=type=cache,id=homarus-apk,sharing=locked,from=cache,target=/var/cach
1919

2020
ENV HOMARUS_LOG_LEVEL=debug
2121

22-
COPY --from=crayfish /etc/nginx/http.d/default.conf /etc/nginx/http.d/default.conf
22+
COPY --from=crayfish /etc/confd /etc/confd
2323
COPY --from=crayfish --chown=nginx:nginx /var/www /var/www
2424

2525
COPY rootfs /

houdini/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ RUN --mount=type=bind,from=imagemagick,source=/packages,target=/packages \
2121

2222
ENV HOUDINI_LOG_LEVEL=debug
2323

24-
COPY --from=crayfish /etc/nginx/http.d/default.conf /etc/nginx/http.d/default.conf
24+
COPY --from=crayfish /etc/confd /etc/confd
2525
COPY --from=crayfish --chown=nginx:nginx /var/www /var/www
2626

2727
COPY rootfs /

hypercube/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ENV \
3232
HYPERCUBE_FCREPO_URL=fcrepo/fcrepo/rest \
3333
HYPERCUBE_LOG_LEVEL=debug
3434

35-
COPY --from=crayfish /etc/nginx/http.d/default.conf /etc/nginx/http.d/default.conf
35+
COPY --from=crayfish /etc/confd /etc/confd
3636
COPY --from=crayfish --chown=nginx:nginx /var/www /var/www
3737

3838
COPY rootfs /

milliner/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ENV \
1717
MILLINER_FEDORA6=false \
1818
MILLINER_LOG_LEVEL=debug
1919

20-
COPY --from=crayfish /etc/nginx/http.d/default.conf /etc/nginx/http.d/default.conf
20+
COPY --from=crayfish /etc/confd /etc/confd
2121
COPY --from=crayfish --chown=nginx:nginx /var/www /var/www
2222

2323
COPY rootfs /

0 commit comments

Comments
 (0)