Question
Phpmyadmin redirect to http://127.0.0.1/index.php?token=... after login (Nginx)
When i log in phpmyadmin, aways redirect to “http://127.0.0.1/index.php?token=…”, shoud be “http://127.0.0.1/phpmyadmin/index.php?token=…”.
This is my nginx/conf.d/default.conf.
server {
listen 80;
listen [::]:80;
root /var/www;
index index.php index.html index.htm *;
server_name 127.0.0.1;
location ~ \.php$ {
include snippets/fastcgi-php.conf;
include fastcgi_params;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ /\.ht {
deny all;
}
#location /phpmyadmin {
# index index.php index.htm;
# alias /usr/share/phpmyadmin;
#}
location / {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
autoindex on;
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
}
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×