Activities

October 2010
M T W T F S S
« Sep   Nov »
 123
45678910
11121314151617
18192021222324
25262728293031

NGINX : http domain requests to www

How do I re-direct the http domain request www domain request in Nginx server.

You need to add two virtualhost. One is for re-directing non-www request and other one is for server www-domain request.

# [root@u15382543 ~]# vi /etc/nginx/conf.d/domain.com.conf

server {    server_name  domain.com;    listen    74.28.17.98:80;     rewrite ^(.*) http://www.domain.com$1 permanent; } […]