Redirect host

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)


On Mar 6, 2014, at 21:38 , Tommy Berglund wrote:

nginx version: nginx/1.4.5 (Ubuntu)

Igor S.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs