Welcome! Log In Create A New Profile

Advanced

404 error despite hours of trying

Posted by evinrude 
404 error despite hours of trying
December 04, 2023 11:55AM
nginx 1.18.0-6.1+deb11u3 on PI4B

my server name is "shares"
I have a directory "/mnt01/Data/Linux"
In it are 2 directories "Documents" and "Downloads"
If my server config contains this

root /mnt01/Data/Linux;
server_name _;
location / {
autoindex on;
autoindex_exact_size on;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

and I browse to "http://shares:8080" I can see the 2 sub directories and access them .

But that is not what I need .
I need to enter something like this "http://shares/Documents:8080" to get to "Documents" and "http://shares/Downloads:8080" to get to "Downloads"

Any other combination of "root ..." , "location ..." , "alias ..." etc etc just gives me a 404 Not Found

This has to be something trivial
Attachments:
open | download - Screenshot_20231204_114152.png (6.5 KB)
Re: 404 error despite hours of trying
December 04, 2023 04:33PM
why doesnt this work ?

location /Docs/ {

alias /mnt01/Data/Linux/Documents/;

}

using http://shares/Docs/:8080

404 still
Re: 404 error despite hours of trying
December 05, 2023 06:55AM
so everyone is thinking 'permission problem' .
I made a directory /mnt02/AAA/BBB
created a "testfile.txt'

changed the directory and the file to be owned www-data
changed the directory and the file perms to be 777
In the server conf

alias /mnt02/AAA/BBB;

404 Not Found
Re: 404 error despite hours of trying
December 05, 2023 09:19AM
this works

server {
listen 8080 default_server;

root /var/www/html;
location / {
autoindex on;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

}


this does not

server {
listen 8080 default_server;

location /html/ {
root /var/www;
autoindex on;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

}
Re: 404 error despite hours of trying
December 05, 2023 09:27AM
I figured it out . Dont ask 'what was it ?' (wasnt perms)

It sucks to get old
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 114
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready