nginx

Nginx index directory

Nginx index directory

To create a download directory is autoindex very practical.

Enable autoindex on /

...
location / {
autoindex on;
}
...

Full configuration for the download page

server {
 listen [2a01:4f8:210:3101::13]:443 ssl spdy ipv6only=on;
 listen 443 ssl spdy;
 spdy_headers_comp 5;

server_name download.safematix.com;

root /srv/www/download.safematix.com/htdocs;

access_log /srv/www/download.safematix.com/log/download.safematix.com_ssl.access.log;
error_log /srv/www/download.safematix.com/log/download.safematix.com_ssl.error.log;

ssl_certificate /etc/nginx/ssl/safematix/download.safematix.com.crt;
ssl_certificate_key /etc/nginx/ssl/safematix/download.safematix.com.key;

ssl_dhparam /etc/nginx/ssl/safematix/download.safematix.com-dhparam.pem;

location / {
autoindex on;
}

include global/ssl.conf;
}

Links:

http://nginx.org/en/docs/http/ngx_http_autoindex_module.html

Leave a Reply

Your email address will not be published. Required fields are marked *