Meteor/Nginx on Ubuntu 16.04 forcing non-www to https

May 22, 2016 2.1k views
Nginx DNS Ubuntu 16.04

Hiyas, I’m following this tutorial - - to point my godaddy domain - to a meteor app deployed to a DO droplet. I’m also using mupx to deploy the meteor app -

Whatever I do, whenever I type in, it takes me to Now I did add 2 A records to my DO domain, @ to ip, and www to ip.

Here’s my nginx vhost -

server {
  listen        80;
  access_log    /var/log/nginx/;
  error_log     /var/log/nginx/;

  location / {
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header X-Forwarded-For $remote_addr;

And I added to this nginx default -

# redirect www to non-www
server {
    listen 80;
    # to redirect all subdomains use * instead of
    server_name *;
    return 301$request_uri;

When I run curl -I - I get -

 curl -I
HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Sun, 22 May 2016 06:50:28 GMT
Connection: keep-alive
Access-Control-Allow-Origin: *

Kinda lost and chasing my tail now, anyone see something that makes sense?

1 Answer

Hi @ghostrunners,

It looks like you may have already resolved the problem, but let us know if you haven’t and if you need any further assistance!

Have another answer? Share your knowledge.