upstream django_server_random27579.example.org { server unix:/srv/http/random21623/live/website.sock; } server { listen 443; server_name random27579.example.org; ssl on; ssl_certificate /etc/ssl/public/random27579.example.org.bundle.crt; ssl_certificate_key /etc/ssl/private/random27579.example.org.key; location /media/ { alias /srv/http/random21623/live/dynamic/public/; expires 7d; include upload_folder_security_params; } location /static/ { alias /srv/http/random21623/live/static_collected/; expires 7d; } location / { proxy_pass http://django_server_random27579.example.org; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Protocol $scheme; } access_log /var/log/nginx/random21623/live/access.log combined_plus; error_log /var/log/nginx/random21623/live/error.log; } server { listen 443; server_name www.random27579.example.org; ssl on; ssl_certificate /etc/ssl/public/random27579.example.org.bundle.crt; ssl_certificate_key /etc/ssl/private/random27579.example.org.key; return 301 https://random27579.example.org$request_uri; } server { listen 80; server_name random27579.example.org www.random27579.example.org random11512.example.org; server_name random18003.example.org www.random18003.example.org; server_name random26730.example.org www.random26730.example.org; server_name random3968.example.org www.random3968.example.org; server_name random11925.example.org www.random11925.example.org; return 301 https://random27579.example.org$request_uri; }