I should get phppgadmin
by example.com/phppgadmin
, but something is going wrong. I could get it by example.com/
(see the comments in conf below). But if I'm trying to get phppgadmin
by creating location
in nginx config I'm getting 404 not found
. What am I doing wrong? Error.log
is fine.
Here is the nginx
conf:
server {
listen 80 default_server;
listen [::]:80 default_server;
# Add index.php to the list if you are using PHP
index index.php index.html index.htm index.nginx-debian.html;
server_name example.com;
#This path works. We are getting phppgadmin by example.com/ ,
#but I need to get it by location (example.com/phppgadmin):
#root /usr/share/phppgadmin;
#This should work but it doesn't:
location /phppgadmin/ {
root /usr/share;
}
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
include fastcgi_params;
}
}