Nginx config virtual hosts

I have this config and, www.domain2.com goes to domain1.com
What do I set in server_name so that all sub-domain requests go to that
server?

xxx.domain2.com-> domain2
thanks

server {
    listen       80;
    server_name  domain1.com;


server {
    listen       80;
    server_name  domain2.com;

On Fri, Dec 07, 2007 at 06:53:03PM -0800, [email protected] wrote:

    server_name  domain1.com;


server {
    listen       80;
    server_name  domain2.com;

If you do not need redirect, then:

     server_name  domain2.com  *.domain2.com;

or (better):

     server_name  .domain2.com;

works great! thanks!

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs