216 questions

223 answers

12 comments

334 users

Welcome to OSSbible, where you can ask Open Source Products questions and receive answers from members of the community. OSSbible has very active & vibrant community members whose knowledge is unparalleled.

How to redirect "www.domain.com" to "domain.com" in nginx

+2 votes
asked Dec 1, 2015 in Linux by William (500 points)

1 Answer

0 votes
Change nginx configuration as below

vim /etc/nginx/sites-enabled/new

server {

server_name www.domain.com;

rewrite ^(.*) http://domain.com$1 permanent;

}

/etc/ini.d/nginx reload
answered Dec 1, 2015 by Ronchi (380 points)
...