Require 'www' for

openletter nginx-forum at
Fri Mar 22 22:44:34 UTC 2013

I am setting up a server that will be for a B2B business, and I want the
whole site to be served as

I have gotten a certificate and runs just fine, but
I can't figure out how to require when a user tries
to go to

In reading through the site, it seems like rewrites and if
statements are discouraged. I did figure out how to require by using the following in my server block file:

server {
           listen [::]:80;
           server_name *;
           return 301 $scheme://$request_uri;

But doing something similar for 443 doesn't seem to work.

Can someone please help me out or point to a good page on setting up for

Posted at Nginx Forum:,237695,237695#msg-237695

More information about the nginx mailing list