Skip to content

Commit 0352d64

Browse files
committed
Matomo: fix use of non-index PHP files
1 parent 647a06c commit 0352d64

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

matomo/Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ RUN apk add --no-cache \
1010
# - crond
1111
COPY matomo/config/crond/ /etc/crontabs/
1212
# - nginx
13-
COPY common/config/nginx/ /etc/nginx/
14-
COPY matomo/config/nginx/http.d/ /etc/nginx/http.d/
13+
COPY common/config/nginx matomo/config/nginx /etc/nginx/
1514
# - s6-overlay
1615
COPY common/config/s6-overlay matomo/config/s6-overlay /etc/s6-overlay/s6-rc.d/
1716
# - init
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# NOTE: different from normal fastcgi, because we need to support non-index.php
2+
# files.
3+
4+
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
5+
fastcgi_split_path_info ^(.+\.php)(/.+)$;
6+
7+
# Check that the PHP script exists before passing it
8+
try_files $fastcgi_script_name =404;
9+
10+
# Bypass the fact that try_files resets $fastcgi_path_info
11+
# see: http://trac.nginx.org/nginx/ticket/321
12+
set $path_info $fastcgi_path_info;
13+
fastcgi_param PATH_INFO $path_info;
14+
15+
# Prohibit httpoxy: https://httpoxy.org/
16+
fastcgi_param HTTP_PROXY "";
17+
18+
fastcgi_index index.php;
19+
include fastcgi.conf;
20+
21+
# Enforce HTTPS (gets lost through chaining proxies)
22+
fastcgi_param REQUEST_SCHEME https;
23+
fastcgi_param HTTPS on;

0 commit comments

Comments
 (0)