mnt Posted March 18, 2015 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; ... }
d00p Posted March 18, 2015 Posted March 18, 2015 sure why not...let froxlor create a redirect (specify an URL in the docroot field) and see the resulting configs
mnt Posted March 18, 2015 Author 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?
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:
3 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.