0
I have a Ubuntu server with nginx installed on it and run a simple node.js app on port 3000.
I managed to configure nginx to serve me the app on /.
My structure looks like this:
mainFolder
app.js etc...
------------->folder1
index.html
----------->folder2
index.html
Now when accessing my servers IP in browser i get the index.html
from folder1: this is correct.
But when i try to access myIp/folder2/index.html
I get :
404 Not Found
Nginx config:
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
location / {
proxy_pass http://localhost:3000;
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
auth_basic "Restricted";
auth_basic_user_file /etc/nginx/.htpasswd;
}
Could somebody explain what I'm doing wrong here pls?
Help would be greatly appreciated.
Thy for your answer but I just managed to get it work. I just commented out: try_files $uri $uri/ =404; – Olivier Krull – 2016-07-12T08:40:15.893