title: Serve flask python on https and another port without https
body: <p>What I'm trying to accomplish.
  Have a domain on https. Check. it's working ok using the following config. The flask app runs on port 1337 -> nginx takes it -> serves it though https. Everything is working nicely</p>
  
  <p>Now I want to run another app, on port 1338 let's say. But if I do this, the browser (chrome) automatically redirects it to https.
  I want: <a href="http://example.com:1338" rel="nofollow noreferrer">http://example.com:1338</a>  .... to run ok
  I get: <a href="https://example.com:1338" rel="nofollow noreferrer">https://example.com:1338</a> ... error certificate</p>
  
  <p>My question is: how can I make the other app (on port 1338) either work with https:// or to work with http://</p>
  
  <p>Here's my config...</p>
  
  <pre><code>server {
          listen 80 default_server;
          listen [::]:80 default_server;
  
  
          root /home/cleverbots;
  
          # Add index.php to the list if you are using PHP
          index index.html index.htm index.nginx-debian.html;
  
          server_name _;
  
  
  
          # SSL configuration
          #
          listen 443 ssl http2 default_server;
          listen [::]:443 ssl http2 default_server;
  
          ssl_certificate     /xxxxxxxxxx.crt;
          ssl_certificate_key /xxxxxxxxxx.key;
  
          ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
          ssl_prefer_server_ciphers on;
          ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
          ssl_ecdh_curve secp384r1;
          ssl_session_cache shared:SSL:10m;
          ssl_session_tickets off;
          ssl_stapling on;
          ssl_stapling_verify on;
          resolver 8.8.8.8 8.8.4.4 valid=300s;
          resolver_timeout 5s;
          # Disable preloading HSTS for now.  You can use the commented out header line that includes
          # the "preload" directive if you understand the implications.
          #add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
          add_header Strict-Transport-Security "max-age=63072000; includeSubdomains";
          add_header X-Frame-Options DENY;
          add_header X-Content-Type-Options nosniff;
  
          ssl_dhparam /xxxxxx/dhparam.pem;
  
  
  
  
          location /static/ {
                 expires 30d;
                 add_header Last-Modified $sent_http_Expires;
                 alias /home/my_first_app/application/static/;
          }
  
  
          location / {
                  try_files $uri @tornado;
          }
  
          location @tornado {
                  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_pass       http://127.0.0.1:1337;
          }
  
  
  
  }
  </code></pre>