Docker, nginx, phpmyadmin. How does php-fpm understand which folder the script is in?
There is the following nginx.conf setting:
server {
listen 80;
server_name localhost;
location ^~ /phpmyadmin {
alias /var/www/phpmyadmin/;
index index.php;
location ~ \.php$ {
try_files $uri = 404;
include fastcgi_params;
fastcgi_split_path_info ^\/phpmyadmin\/(.+\.php)(.*)$; # Получаем "index.php"
fastcgi_param SCRIPT_FILENAME $fastcgi_script_name; # Вставляем "index.php"
fastcgi_pass phpmyadmin:9000;
}
}
}
When accessing https://localhost/phpmyadmin/ the request is passed to the container with php-fpm, after which it somehow passes the request along the path /var/www/html/index.php although I didn't specify this path in the location ~ \.php$ {...}
section, and the phpmyadmin files are only there.
Question: How can php-fpm know about this path (/var/www/html/index.php) and pass requests there if I didn't specify it? Could it be such that the default path is specified in the container? Using phpmyadmin/phpmyadmin:fpm-alpine
0
Author: Coffee inTime, 2020-04-08