upstream django_server_random10783.example.org { server unix:/srv/http/random4711/acceptance/website.sock; } server { listen 80; server_name random10783.example.org; location ^~ /media/ { alias /srv/http/random4711/acceptance/dynamic/public/; expires 7d; } location ^~ /static/ { alias /srv/http/random4711/acceptance/static_collected/; expires 7d; } location / { proxy_pass http://django_server_random10783.example.org; include /etc/nginx/proxy_params; proxy_read_timeout 4m; satisfy any; auth_basic 'acceptance for random4711'; auth_basic_user_file /srv/http/random4711/acceptance/htpasswords; include /etc/nginx/allow_ytec_ips_params; deny all; } access_log /var/log/nginx/random4711/acceptance/access.log combined_plus; error_log /var/log/nginx/random4711/acceptance/error.log; } server { server_name www.random10783.example.org; rewrite ^ http://random10783.example.org$request_uri permanent; }