title: Adding another Django site breaks existing SSL Django site
body: <p>I have:</p>
  
  <ul>
  <li>Debian Virtual Server</li>
  <li>Nginx</li>
  <li>Static sites served</li>
  <li>Non SSL Django site served</li>
  <li>SSL Django site served</li>
  </ul>
  
  <p>I've tried adding a new Django site (WR) using existing configuration files as a template. WR works but the existing SSL site (TC) then gives an SSL error when I add a symbolic link and restart Nginx.</p>
  
  <p>I cannot work out why it breaks TC and wondered if anyone could help?</p>
  
  <p>Removing the link to the configuration file for WR and restarting Nginx fixes TC.</p>
  
  <p>Adding a basic Nginx conf file to serve a static page for WR does not break TC.</p>
  
  <p>Another non-SSL Django site (HO) on the same server that was set up before TC was converted to SSL continues to work regardless.</p>
  
  <p>I've checked and triple checked the various configuration files required to serve WR but cannot work out why activating it breaks TC.</p>
  
  <p>Any ideas?</p>
  
  <p>thinkingcomputing.com (TC) Nginx config</p>
  
  <pre><code>upstream tc_app_server {
    server unix:/path/to/venv/run/gunicorn.sock fail_timeout=0;
  }
  
  server {
      listen 80;
      server_name thinkingcomputing.com www.thinkingcomputing.com;
      return 301 https://www.thinkingcomputing.com$request_uri;
  }
  
  server {
      listen 443 ssl;
      ssl_certificate /path/to/ssl.crt;
      ssl_certificate_key /path/to/key.key;
  
      ssl_session_cache shared:SSL:20m;
      ssl_session_timeout 180m;
  
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_prefer_server_ciphers on;
      ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  
      server_name thinkingcomputing.com;
      return 301 https://www.thinkingcomputing.com$request_uri;
  
  }
  
  server {
      listen 443 ssl;
  
      ssl_certificate /path/to/ssl.crt;
      ssl_certificate_key /path/to/key.key;
  
      ssl_session_cache shared:SSL:20m;
      ssl_session_timeout 180m;
  
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_prefer_server_ciphers on;
      ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH';
  
      server_name www.thinkingcomputing.com;
  
      client_max_body_size 4G;
  #
  # ACCESS LOG PATHS AND FILE LOCATIONS REMOVED
  #
      location / {
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header X-Forwarded-Proto https;
          proxy_set_header Host $http_host;
          proxy_redirect off;
          if (!-f $request_filename) {
              proxy_pass http://tc_app_server;
              break;
          }
      }
  #
  # ERROR PAGE LOCATIONS
  #
  }
  </code></pre>
  
  <p>westraven.co.uk (WR) Nginx config:</p>
  
  <pre><code>upstream wr_app_server {
    server unix:/path/to/venv/run/gunicorn.sock fail_timeout=0;
  }
  
  
  server {
      listen 80;
      listen 443 ssl;
      server_name westraven.co.uk;
      return 301 $scheme://www.westraven.co.uk$request_uri;
  }
  
  server {
  
      listen   80;
      listen 443 ssl;
      server_name www.westraven.co.uk;
  
      client_max_body_size 4G;
  
  #
  # ACCESS AND ERROR LOG PLUS OTHER FILE LOCATIONS REMOVED
  #
  
      location / {
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_redirect off;
          if (!-f $request_filename) {
              proxy_pass http://wr_app_server;
              break;
          }
      }
  
  #
  # ERROR PAGES LOCATIONS REMOVED
  #
  }
  </code></pre>