0

I'm having trouble with nginx, autoindex and location/URL.

Here is my configuration :

server {
        listen 443 ssl;
        server_name test;

        # log
        access_log  /var/log/nginx/test.access.log;
        error_log   /var/log/nginx/test.error.log;

        # SSL
        ssl_certificate     /etc/nginx/ssl/test.cer;
        ssl_certificate_key /etc/nginx/ssl/test.key;
        include             /etc/nginx/ssl.conf;

        location / {

               root                    /mnt/data;
               autoindex               on;
               autoindex_exact_size    off;

        }
}

I can access my files (present in /mnt/data) with the URL : www.test.net/

But I want to access to theses files through URL : www.test.net/browse/

If I put location /browse {...} nginx seems to try to access to /mnt/data/browse which does not exsit.

Should I use rewrite rules and how ?

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.