Home  >  Article  >  Backend Development  >  nginx does not redirect www to www domain name

nginx does not redirect www to www domain name

WBOY
WBOYOriginal
2016-07-30 13:29:491429browse

nginx without redirection from www to www domain name

Here, if it is a single redirection, use redirect, if it is a permanent jump, use permanent, here use permanent

{

                                                                                       listen

               server_name xxx.com www.xxx.com;

Index index.html index.php;

root/data/www/wwwroot;

If ($ http_host! ~ "^www.xxx.com $") {

E REWRITE ^(.*) Http://www.xxx.com $1 permanent;

}

... ...        }

Copyright Statement: This article is an original article by the blogger and may not be reproduced without the blogger's permission.
The above introduces the redirection of nginx without www to www domain name, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn