Process code review feedback

Remove unneeded IF statement in /admin block in nginx.conf of front.
Fix contributions made to Dockerfile, add missing trailing \ and add back curl
Change healthcheck to monitoring page of fpm. Now we check nginx and fpm.
master
Dimitri Huisman 2 years ago
parent 9d0c49a844
commit ee78a34da4

@ -213,9 +213,6 @@ http {
{% endif %} {% endif %}
{% if ADMIN == 'true' %} {% if ADMIN == 'true' %}
location {{ WEB_ADMIN }} { location {{ WEB_ADMIN }} {
{% if WEB_ADMIN != '/' %}
rewrite ^({{ WEB_ADMIN }})$ $1/ permanent;
{% endif %}
include /etc/nginx/proxy.conf; include /etc/nginx/proxy.conf;
proxy_pass http://$admin; proxy_pass http://$admin;
expires $expires; expires $expires;

@ -43,7 +43,7 @@ RUN apk add --no-cache \
# zip php7-zip # zip php7-zip
#php7-curl php7-iconv php7-json php7-xml php7-simplexml php7-dom php7-openssl php7-pdo php7-pdo_sqlite php7-mbstring \ #php7-curl php7-iconv php7-json php7-xml php7-simplexml php7-dom php7-openssl php7-pdo php7-pdo_sqlite php7-mbstring \
RUN apk add --no-cache \ RUN apk add --no-cache \
nginx \ nginx curl \
php7 php7-fpm php7-mbstring php7-zip php7-json php7-xml php7-simplexml \ php7 php7-fpm php7-mbstring php7-zip php7-json php7-xml php7-simplexml \
php7-dom php7-curl php7-exif gd php7-gd php7-iconv php7-intl php7-openssl \ php7-dom php7-curl php7-exif gd php7-gd php7-iconv php7-intl php7-openssl \
php7-pdo_sqlite php7-pdo php7-sodium libsodium php7-tidy php7-pecl-uuid \ php7-pdo_sqlite php7-pdo php7-sodium libsodium php7-tidy php7-pecl-uuid \
@ -66,7 +66,7 @@ COPY defaults/default.ini /defaults/default.ini
ENV SNAPPYMAIL_URL https://github.com/the-djmaze/snappymail/releases/download/v2.13.4/snappymail-2.13.4.zip ENV SNAPPYMAIL_URL https://github.com/the-djmaze/snappymail/releases/download/v2.13.4/snappymail-2.13.4.zip
RUN cd /var/www/webmail \ RUN cd /var/www/webmail \
&& busybox wget ${SNAPPYMAIL_URL} -O - |busybox unzip - && busybox wget ${SNAPPYMAIL_URL} -O - | busybox unzip - \
&& chmod -R u+w,a+rX /var/www/webmail \ && chmod -R u+w,a+rX /var/www/webmail \
&& chown -R nginx:nginx /var/www/webmail && chown -R nginx:nginx /var/www/webmail
@ -82,5 +82,5 @@ VOLUME ["/data"]
CMD /start.py CMD /start.py
HEALTHCHECK CMD curl -f -L http://localhost/health || exit 1 HEALTHCHECK CMD curl -f -L http://localhost/ping || exit 1
RUN echo $VERSION >> /version RUN echo $VERSION >> /version

@ -22,10 +22,12 @@ server {
} }
location ~ \.php$ { location ~ \.php$ {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
include /etc/nginx/fastcgi_params; include /etc/nginx/fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_intercept_errors on; fastcgi_intercept_errors on;
fastcgi_index index.php; fastcgi_index index.php;
@ -48,8 +50,13 @@ server {
deny all; deny all;
} }
location /health { location = /ping {
add_header Content-Type text/plain; allow 127.0.0.1;
return 200; deny all;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php7-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
} }
} }

@ -99,3 +99,20 @@ pm.process_idle_timeout = 10s
; Equivalent to PHP_FCGI_MAX_REQUESTS. Default value: 0. ; Equivalent to PHP_FCGI_MAX_REQUESTS. Default value: 0.
; Noted: Used only when pm is set to 'ondemand' ; Noted: Used only when pm is set to 'ondemand'
pm.max_requests = 200 pm.max_requests = 200
; The ping URI to call the monitoring page of FPM. If this value is not set, no
; URI will be recognized as a ping page. This could be used to test from outside
; that FPM is alive and responding, or to
; - create a graph of FPM availability (rrd or such);
; - remove a server from a group if it is not responding (load balancing);
; - trigger alerts for the operating team (24/7).
; Note: The value must start with a leading slash (/). The value can be
; anything, but it may not be a good idea to use the .php extension or it
; may conflict with a real PHP file.
; Default Value: not set
ping.path = /ping
; This directive may be used to customize the response of a ping request. The
; response is formatted as text/plain with a 200 response code.
; Default Value: pong
;ping.response = pong

Loading…
Cancel
Save