Answer the question
In order to leave comments, you need to log in
Why does it give 404 error (nginx+alias)?
This configuration works:
location /phpmyadmin {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/phpmyadmin/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~* ^/phpmyadmin/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location /pma {
alias /usr/share/phpmyadmin;
index index.php index.html index.htm;
location ~ ^/pma/(.+\.php)$ {
alias /usr/share/phpmyadmin/$1;
try_files $uri =404;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~* ^/pma/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
alias /usr/share/phpmyadmin/$1;
}
}
Answer the question
In order to leave comments, you need to log in
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
and your root is /usr/share/ /usr/share/pma/index.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question