Welcome! Log In Create A New Profile

Advanced

Non-Root Location doesn't work

Posted by PascalTurbo 
Non-Root Location doesn't work
May 23, 2012 12:16PM
Hi There,

first I asked this question at StackOverflow because I thougt it is nginx-related.
Now founding out that it serves html correctly I think it might be an php - problem.

Here is my configuration:

server {
listen 80;
server_name localhost;

location /phpMyAdmin {
alias /var/www/phpMyAdmin/htdocs/;

index index.php;

access_log /var/www/phpMyAdmin/logs/access.log;
error_log /var/www/phpMyAdmin/logs/error.log;
}

location ~ \.php$ {
include fastcgi_params;
try_files $uri =404;
fastcgi_pass unix:/var/www/sockets/www.socket;
}
}


I added an index.html-file for testing and this serves perfectly.

Then for testing I change root to the phpMyAdmin Folder:

server {
listen 80;
server_name localhost;

root /var/www/phpMyAdmin/htdocs/;

index index.php;

location /{
index index.php;
}

location ~ \.php$ {
include fastcgi_params;
try_files $uri =404;
fastcgi_pass unix:/var/www/sockets/www.socket;
}
}

and this is working, too.

But I need it in that subfolder... and all I get is a damn 404

Any suggestions?

Thanks allot
Pascal
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 305
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready