server { listen 80; server_name awstats-nginx.nausch.org; access_log /var/log/nginx/awstats-nginx_access.log; error_log /var/log/nginx/awstats-nginx_errors.log; # Restrict access #auth_basic "AWStats Webserverstatistiken on vml000097 - nausch.org"; #auth_basic_user_file /etc/awstats/htpasswd; # Static awstats files: HTML files stored in DOCUMENT_ROOT/awstats/ location /awstats/classes/ { alias /usr/share/awstats/wwwroot/classes/; } location /awstats/css/ { alias /usr/share/awstats/wwwroot/css/; } location /awstats/icon/ { alias /usr/share/awstats/wwwroot/icon/; } location /awstatsicons/ { alias /usr/share/awstats/wwwroot/icon/; } location /awstats/js/ { alias /usr/share/awstats/wwwroot/js/; } # URL beautifying location ~ ^/([a-z0-9-_\.]+)$ { return 301 $scheme://$server_name/cgi-bin/awstats.pl?config=$1; } # Dynamic stats. location ~ ^/cgi-bin/(awredir|awstats)\.pl { gzip off; fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /usr/share/awstats/tools/nginx/awstats-fcgi.php; fastcgi_param X_SCRIPT_FILENAME /usr/share/awstats/wwwroot$fastcgi_script_name; fastcgi_param X_SCRIPT_NAME $fastcgi_script_name; include fastcgi_params; } }