meteorhacks / mup-frontend-server

Frontend Server for Meteor Up
37 stars 35 forks source link

Redirect www to non-www #16

Open lfilho opened 7 years ago

lfilho commented 7 years ago

Hey there, thanks for work!!

I would like to configure my website to be acessible both from www and non-www. Right now I want to redir from www to non-www, but I would happily go the other way around too.

Right now when users access my www.domain.com it errors out and they are left thinking my site is offline. Of course it is running fine in domain.com.

Is there a way to accomplish that? Or how easy would it be to support it? I'm happy to contribute but bear in mind that i'm still learning nginx/servers world (i'm mainly a frontend dev with basic knowledge on docker, shell, etc).

Thanks

fisherman818 commented 7 years ago

at your nginx site configuration file:

server {
    listen 80;
    server_name www.domain.com;
    return 301 http://domain.com$request_uri;
}

then sudo service nginx restart