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

server {
    listen 443 ssl;
    server_name random2179.example.org;

    ssl_certificate empty_cert.pem;
    ssl_certificate_key key2.pem;


    location /media/ {
        alias /srv/http/random550/live/dynamic/public/;
        expires 7d;
#        include upload_folder_security_params;
    }
    location /static/ {
        alias /srv/http/random550/live/static_collected/;
        expires 7d;
    }

    location / {
#        proxy_pass http://django_server_random6177.example.org;
        include          /etc/nginx/django_proxy_params;
    }

    access_log /var/log/nginx/access_log combined;
    error_log  /var/log/nginx/error_log;
}

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

    location /media/ {
        alias /srv/http/random550/live/dynamic/public/;
        expires 7d;
#        include upload_folder_security_params;
    }
    location /static/ {
        alias /srv/http/random550/live/static_collected/;
        expires 7d;
    }

    #location = / {
    #    return 301 https://random2179.example.org$request_uri;
    #}

    location / {
#        proxy_pass http://django_server_random6177.example.org;
        include          /etc/nginx/django_proxy_params;
    }

    access_log /var/log/nginx/access_http.log combined;
    error_log  /var/log/nginx/error_http.log;
}

server {
    server_name random6177.example.org www.random6177.example.org;
    return 301 http://random2179.example.org$request_uri;
}
