upstream django_server_random1413.example.org { server unix:/srv/http/random25151/live/website.sock; } server { listen 443; server_name www.random25266.example.org; ssl on; ssl_certificate /etc/ssl/public/random25266.example.org.bundle.crt; ssl_certificate_key /etc/ssl/private/random25266.example.org.key; location /media/ { alias /srv/http/random25151/live/dynamic/public/; expires 7d; include upload_folder_security_params; } location /static/ { alias /srv/http/random25151/live/static_collected/; expires 7d; } location / { proxy_pass http://django_server_random1413.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; } access_log /var/log/nginx/random25151/live/access.log combined_plus; error_log /var/log/nginx/random25151/live/error.log; } server { listen 443; server_name random1413.example.org www.random1413.example.org; ssl on; ssl_certificate /etc/ssl/public/random1413.example.org.bundle.crt; ssl_certificate_key /etc/ssl/private/random1413.example.org.key; location / { return 301 https://www.random25266.example.org$request_uri; } } server { listen 443; server_name random25266.example.org; ssl on; ssl_certificate /etc/ssl/public/random25266.example.org.bundle.crt; ssl_certificate_key /etc/ssl/private/random25266.example.org.key; location / { return 301 https://www.random25266.example.org$request_uri; } } server { listen 80; server_name random1413.example.org www.random1413.example.org; server_name random28524.example.org www.random28524.example.org; server_name random25266.example.org www.random25266.example.org; server_name random26791.example.org www.random26791.example.org; location / { return 301 https://www.random25266.example.org$request_uri; } }