diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..7dec8b4 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,24 @@ +server { + listen 80; + server_name your_domain.com; + + root /var/www; + + # Main location block + location / { + try_files $uri $uri/ =404; + } + + # User directories + location ~ ^/~(.+?)(/.*)?$ { + alias /var/www/$1$2; + autoindex on; + index index.html; + try_files $uri $uri/ /~$1/index.html; + } + + error_page 404 /404.html; + location = /404.html { + internal; + } +}