Welcome! Log In Create A New Profile

Advanced

noob needs help with alias locations and php

Mike Wright
May 28, 2015 12:50AM
Hi all,

Been going in circles for the third day now.

The server handles files and php scripts as long as they are at or
beneath the document root. Here are the two problems I haven't been
able to figure out:
Directory index of ... is forbidden
Can't get to docs not beneath the document_root.

Example of places I want to go:

non-root targets: as:
/home/mike/Movies/index.html /movies/index.html 200
/home/mike/Movies/index.php /movies/index.php "File not found."
/home/mike/Movies/1/index.html /movies/1/index.html 404
/home/mike/Movies/1/index.php /movies/1/index.php "File not found."

File not found : "Primary script unknown";
404 : the log shows the correct GET path;
A lot of my experiments end up with 301 : endless redirects;

http {
index index.html index.php;
...

server {
listen 80;
server_name localhost lo;
root /var/www/sites/localhost/www;

location / {
try_files $uri $uri/ /index.html /index.php;
}

location /movies {
alias /home/mike/Movies/;
}

location ~ \.php$ {
root /var/www/sites/localhost/www;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}

If I can get past these hurdles I'll probably (hopefully) be able to
figure most of the rest of this stuff out.

Tips, pointers appreciated. Helper?

Thanks,
Mike Wright

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

noob needs help with alias locations and php

Mike Wright May 28, 2015 12:50AM

Re: noob needs help with alias locations and php

Francis Daly May 28, 2015 04:04AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 196
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