I don't understand my nginx not serve file from '/var/www/html/foo/' when I execute 'w3m http://localhost/foo/test.html'? I get 404 error, despite of existing test.html in '/var/www/html/foo/'. When I checked log I see that it looking for page in '/var/www/html/nginx/foo/test.html'.
user nobody nogroup; worker_processes 2; events { worker_connections 512; } http { server { listen *:80; listen *:1026; server_name "test"; root /var/www/html/nginx/ ; location foo/ { alias /var/www/html/foo/ ; } } } arek@127:~$ ls /var/www/html/nginx test.html arek@127:~$ ls /var/www/html/foo index.html test_bigger.html test.html text.html arek@127:~$ When I checked log I see that it looking for page in '/var/www/html/nginx/foo/test.html'
2022/09/03 02:36:05 [error] 139475#139475: *2 open() "/var/www/html/nginx/foo/test.html" failed (2: No such file or directory), client: 127.0.0.1, server: test, request: "GET /foo/test.html HTTP/1.0", host: "localhost" when I change my root path on '/var/www/html/' its works.
/var/www/html/or/var/www/htmlwhich sounds more normal for static html files? And it works with your testing.