Answer the question
In order to leave comments, you need to log in
How to rewrite location for nginx more "beautifully"?
Friends, hello. To access phpMyAdmin installed from the repository on CentOS 7, I have the following location in the nginx config:
location /pma/ {
alias /usr/share/phpMyAdmin/;
try_files $uri $uri/ =404;
index index.php index.html index.htm;
location ~ ^/pma/(.+\.php)$ {
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$1;
include fastcgi_params;
}
}
Could you tell me how to rewrite it more accurately? In order, firstly, not to repeat in two places /pma/
, and, secondly, so that nginx gives a 404 error to non-existent php files, and not No input file specified.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question