mardi 19 mai 2015

I am trying to enable http access to a user directory on nginx

I am trying to access a directory inside /home over http

The directory I am trying to access is /home/user-name/saved/downloads/

Trying to access it at http://serverip/downloads/user-name

I'm not sure why this isn't working as intended, could someone explain?

location ~ ^/download/(.+?)(/.*)?$ {    alias /home/$1$2;
    set $user $1;
    if ($remote_user = '') { break; }
    if ($user != $remote_user) { return 403; }
    auth_basic "Restricted";
    auth_basic_user_file /etc/nginx/.htpasswd;
    index index.html index.htm; autoindex on;
}

This is the content of /etc/nginx/conf.d/rtdload

Note: this is not written by me but I have the right to use it




Aucun commentaire:

Enregistrer un commentaire