views:

61

answers:

2

It really bites having to add an alias every time you need a subdomain on your development machine. Is there a way to configure passenger to use wildcards so that i can access randomsubdomain.mysite.local ?

+3  A: 

This is not a passenger problem. It depends on which server you're using:

nginx:

server {
    # …
    server_name www.yourdomain.com *.yourdomain.com;
    # …
}

apache:

<VirtualHost …>
    # …
    ServerName www.yourdomain.com
    ServerAlias *.yourdomain.com
    # …
</VirtualHost>
jigfox
+1  A: 

In order to have wildcard subdomains you need to have a DNS server running on your local machine. Below are some articles that got it working for me:

  1. Setup bind (only step 1 in this article)
  2. Configure DNS server (Replace 'vmdev' with 'local' in this article)
  3. add *.app.local in passenger pref pane 'Aliases' for each app