Home  >  Article  >  Backend Development  >  nginx domain name 301 redirect rewrite jump no www jump to www

nginx domain name 301 redirect rewrite jump no www jump to www

WBOY
WBOYOriginal
2016-07-29 08:59:511105browse

Seerver {i Listen 80;

server_name www.xxx.com xxx.com;
if ($ host = xxx.com) {
rwrite ^/(.*) $ Http://www.xxx.com/ $1 Permanent;
}

error_page 502 503 504 /50x.html ;
local = /50x.html {
root html; set_header X-Real-IP $ remote_addr;
proxy_set_header
The above introduces nginx domain name 301 redirection, rewrite jump, no www jump to www, including the 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
Previous article:Pseudotypes in PHPNext article:Pseudotypes in PHP