Posted by Anurag in
Wednesday, April 18. 2012
Nginx doesn't have mod_userdir like Apache, but the behavior can be emulated by the following configuration snippet.
# userdir simulation
location ~ /~([^/]+)($|/.*)$ {
alias /home/$1/public_html$2;
error_page 404 = @404;
autoindex on;
}
location @404 {
return 404;
}
Putting these location directives in a virtual host config section will let the virtual host publish user's public_html directories.