Redirect host

Tommy Berglund tommy at
Thu Mar 6 17:38:51 UTC 2014

I have a question, is this the best way to perform this action?

Only allow in the server block ssl
  and redirect any host that isn't to the

if ($host !~* '' ) {
         rewrite ^/(.*)$$1 permanent;

nginx version: nginx/1.4.5 (Ubuntu)


More information about the nginx mailing list