server {
listen 80;
server_name www.xxx.com xxx.com;
if ($host = xxx.com )
if ($host = xxx.com )
if ($host = xxx.com ) if ($host = xxx.com )
www.xxx.com/$1 permanent;
}
error_page 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass http://127.0.0.1:8080;
}
}
以上就介紹了nginx 域名301重定向 rewrite跳轉 無www跳到有www,包括了方面的內容,希望對PHP教程有興趣的朋友有所幫助。 🎜
🎜
🎜