Install, configure and protect Awstats for multiple nginx vhost on Debian/Ubuntu

There’s already a lot of tutorial on internet on how to install awstats for nginx. I didn’t find any for the configuration I wanted, so I’ll write one, for my record.

I have some custom needs, let’s suppose I have 3 domains :

  • master-domain.com
  • alpha.com
  • beta.com

And I want to have stats for the 2 latest domains. The master-domain.com is used as the master domain of the server, with awstats available at awstats.master-domain.com, instead of having alpha.com/awstats and beta.com/awstats. The idea it to group all the server script/tools (phpmyadmin, zabbix, etc …) under master-domain.com. Continue reading Install, configure and protect Awstats for multiple nginx vhost on Debian/Ubuntu

Nginx directory index

Enabling directory listing in a folder in nginx is simple enough with just an autoindex on; directive inside the location directive.

You can enable sitewide directory index by putting it in the server block or even enable directory access for all sites by putting it in the http block.

An example config file:

server {
        listen   80;
        server_name  domain.com www.domain.com;
        access_log  /var/...........................;
        root   /path/to/root;
        location / {
                index  index.php index.html index.htm;
        }
        location /somedir {
               autoindex on;
        }
}

Tags for Nginx directory index

nginx list files in folder
nginx show directory listing
nginx enable directory listing
nginx directory index
nginx list directory
nginx list directory contents