meteor / todos

The example app "Todos", written following the Meteor Guide
Other
535 stars 367 forks source link

http://todos.mysite.com redirect to https://todos.mysite.com #250

Closed sitexa closed 6 years ago

sitexa commented 6 years ago

I deployed todos(git clone from react branch) to CentOS 7 with nginx, when browse http://todos.mysite.com, the browser is redirected to https://todos.mysite.com. That means the app is ssl secured? I cannot find where to configure the ssl with cert.ca and privkey.

Meantime , when I follow the tutorial todos - react version step by step, deployed it to CentOS 7 behind Nginx, i can browse it without https.

nginx.conf:

server {
        listen 80;
        listen [::]:80;

        root /var/www/todos.mysite.com/html;
        index index.html index.htm index.nginx-debian.html;

        server_name todos.mysite.com;

        location / {
                proxy_pass http://todos.mysite.com:3000/;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
                proxy_set_header Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forward-Proto http;
                proxy_set_header X-Nginx-Proxy true;
                proxy_redirect off;
        }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/todos.mysite.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/todos.mysite.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    if ($scheme != "https") {
        return 301 https://$host$request_uri;
    } # managed by Certbot
}

and todos start script:

export MONGO_URL=mongodb://127.0.0.1:27017/todos
export ROOT_URL=http://todos.mysite.com
export PORT=3000
node bundle-0/main.js

bundle-0 is step by step version, bundle-1 is the cloned version. the bundle-0 works well and the bundle-1 not.

Can anybody help?

abernix commented 6 years ago

Your question is out of scope of this repository but you can also ask for help on the Meteor forums or Stack Overflow tagged with meteor.