mnt Posted March 18, 2015 Share Posted March 18, 2015 I want redirect non-www domain to www with nginx. Example: test.com -> www.test.com Is possible to have two server declaration for one domain in nginx config? Example: server { listen 80; server_name test.com; return 301 http://www.test.com$request_uri; } server { listen 80; server_name www.test.com; ... } Link to comment Share on other sites More sharing options...
d00p Posted March 18, 2015 Share Posted March 18, 2015 sure why not...let froxlor create a redirect (specify an URL in the docroot field) and see the resulting configs Link to comment Share on other sites More sharing options...
mnt Posted March 18, 2015 Author Share Posted March 18, 2015 I need create two domains separately? 1. test.com 2. www.test.com And in test.com docroot field insert url: http://www.test.com? Link to comment Share on other sites More sharing options...
d00p Posted March 18, 2015 Share Posted March 18, 2015 that's one way, yes Link to comment Share on other sites More sharing options...
Question
mnt
I want redirect non-www domain to www with nginx.
Example: test.com -> www.test.com
Is possible to have two server declaration for one domain in nginx config?
Example:
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.