Tutorials

:: nginx : www to non-www domain

:: How to redirect www to non-www domain in nginx
+ edit nginx.conf or your virtualhost file

vi /etc/nginx/nginx.conf

+ add redirecting on server {}

if ($host = 'www.blackonsole.org') {
         rewrite  ^/(.*)$  //blackonsole.org/$1  permanent;
      }

+ reload nginx

nginx -s reload

 
:: Links
+ Google
+ CyberCiti

Hi, I’m Sysadmin.ID

Leave a Reply

Your email address will not be published. Required fields are marked *