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 ?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.