Images Aren't Displaying When Perl Interpreter Is Enabled

MasterMind nginx-forum at
Thu Jan 16 07:47:30 UTC 2014

I have awstats set up and working with Nginx and perl but all images return
a 404 error. The virtual host config is identical to other websites where
images work fine except for the added part for perl.

I think i know what's happening but i dont know how to fix it; images are
being sent to the perl interpreter instead of Nginx. Here's my config:

server {
rewrite ^ https://$server_name$request_uri? permanent;

server {

access_log /path/to/logs/stats/access.log;

    error_log  /path/to/logs/stats/error.log;

    index index.html index.htm;
    client_max_body_size 40M;

    ssl on;
    ssl_certificate /etc/nginx/ssl/ssl.crt;
    ssl_certificate_key /etc/nginx/ssl/private.key;

    location / {
    root   /path/to/the/awstats/wwwr;
    index  index.html index.htm;
    try_files $uri $uri/ /index.html?$uri&$args;
    auth_basic            "Restricted";
    auth_basic_user_file   /path/to/the/awstats/htpasswd;

    # Block Image Hotlinking
    location /icon/ {
    valid_referers none blocked;
    if ($invalid_referer) {
    return   403;

    # Dynamic stats.
    location ~ \.pl$ {
    gzip off;
    include /etc/nginx/fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME 

Posted at Nginx Forum:,246500,246500#msg-246500

More information about the nginx mailing list