upstream django_server_random24919.example.org {
    server unix:/srv/http/random7831/live/website.sock;
}

server {
    listen 80;
    server_name random24919.example.org;

    location ^~ /media/ {
        alias /srv/http/random7831/live/dynamic/public/;
        expires 7d;
    }
    location ^~ /static/ {
        alias /srv/http/random7831/live/static_collected/;
        expires 7d;
    }

    location / {
        proxy_pass http://django_server_random24919.example.org;
        include          /etc/nginx/proxy_params;

        proxy_connect_timeout 240;
        proxy_read_timeout 240;
    }

    access_log /var/log/nginx/random7831/live/access.log combined_plus;
    error_log  /var/log/nginx/random7831/live/error.log;
}

server {
    server_name www.random24919.example.org;
    rewrite ^ http://random24919.example.org$request_uri permanent;
}
