wout
December 12, 2019, 7:05pm
1
I am setting up a Dockerized installation of Kirby 3 with Nginx and PHP-FPM (7.3). I can access the site and I could set up a user account but got this error afterwards:
Every time I try to access the /panel now, I am getting this error. But when I launch Kriby with the PHP’s built-in server, everything works as expected. As this is a rather non-descriptive error, I am a bit stuck.
On the built-in PHP server, while visiting /panel, the output is the following:
On nginx, while visiting /panel:
So, clearly Kirby is blocking the request somehow. Can anybody give me some pointers on how to get around this issue?
Thanks!
texnixe
December 12, 2019, 7:27pm
2
Is there any more information in your browser console?
wout
December 12, 2019, 7:50pm
4
FWIW, here is my docker-compose recipe. It is fairly simple, so you can test for yourself:
# docker-compose.yml
version: "3"
services:
web:
image: nginx:latest
ports:
- "3141:3141"
volumes:
- .:/app
- ./nginx.conf:/etc/nginx/conf.d/default.conf
php:
image: php:7.3-fpm
volumes:
- .:/app
- ./log.conf:/usr/local/etc/php-fpm.d/zzz-log.conf
The Nginx configuration file:
# nginx.conf
server {
listen 3141;
index index.php index.html;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /app;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
And the logger configuration:
# log.conf
php_admin_flag[log_errors] = on
php_flag[display_errors] = off
Just create those files inside the Kirby app directory and run sudo docker-compose up
.
texnixe
December 12, 2019, 7:57pm
5
Hm, I can’t really help with this. Let’s wait and see if someone with Docker/Nginx experience has an idea.
wout
December 12, 2019, 7:58pm
6
I had the same issue on Apache, so I suppose it is Docker+Kirby related.
texnixe
December 19, 2019, 7:32am
7
@wout Have you found a way to solve this issue?
wout
December 19, 2019, 9:48am
8
@texnixe Thanks for the follow-up. I have yet to dig deeper into the issue. I will have to do some reverse engineering to get to the bottom of it. Probably next week I can make some time and I will report back with my findings.
wout
December 21, 2019, 6:50pm
9
I have been working on this project running on the built-in PHP server. Just now, I tried the docker setup again and I am getting different errors:
All those errors are coming from panel/dist/js/app.js:
This is all in Firefox. When using Brave (based on Chrome), the following errors show up:
I am starting to get the feeling Kirby is not playing nice with the docker proxy. All errors seem to be related to API calls coming from Vue.js.