1

This is a bit of a beginner question, but I'm trying to make Nginx serve a static file server that contains symlinked folders. Eg, the root directory might contain directories A and B, which each contain symlinks to one other, eg A/B -> B and B/A -> A and I'd like http://localhost/A/B/A/B to follow the symlinks and render the index.html in B.

This is the config file I've tried after reading many tutorials and examples, but I'm still not quite understanding:

http {
    server {
        listen 8011;

        location / {
            autoindex on;
            disable_symlinks off;
            root /Users/me/project/test_project/build;
        }
    }
}

events {
  worker_connections  4096;  ## Default: 1024
}
6
  • So what is happening with this configuration? Aug 24, 2022 at 20:25
  • @TeroKilkanen It doesn't even seem as if http://localhost:8011/A/ is working, I get 404 Not Found, only http://localhost:8011/ works, so maybe I'm not even telling it to handle requests to subdirectories? Not sure. Thanks
    – ak0000
    Aug 24, 2022 at 22:23
  • Anything in nginx logs? Aug 24, 2022 at 22:44
  • Nothing too surprising, requesting the root works, requesting anything else doesn't: 127.0.0.1 - - [24/Aug/2022:19:12:17 -0400] "GET / HTTP/1.1" 200 283 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36" 127.0.0.1 - - [24/Aug/2022:19:12:20 -0400] "GET /A/ HTTP/1.1" 404 555 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36"
    – ak0000
    Aug 24, 2022 at 23:14
  • What is in error log? Aug 25, 2022 at 6:25

0

You must log in to answer this question.

Browse other questions tagged .