Using vagrant share with multiple subdomains in an nginx configuration.

441 views
Skip to first unread message

Josh Freeman

unread,
Jun 20, 2014, 5:38:39 AM6/20/14
to vagra...@googlegroups.com
Hello,

In my NGINX configuration I have a couple server objects setup assigned to different sub domains, eg:

server_name test.dev
server_name cms.test.dev
server_name other.test.dev

and so on, each in their own server { } object.

These all work fine and dandy but I would like to if possible get the cms.* and other.* working through vagrant share.

So far, by just putting *.vagrantshare.com into one of the objects, it will load the subdomain root folder for that path fine, but that means I can only have 1 share url matching 1 server route at a time. If I do cms.* and other.* for the server name then it mostly works, but then test.dev will not work as there is no subdomain for that.

This might be more of a nginx question than vagrant share, but i was wondering if this is possible to, so in the end I would have:


and so on.

Any advice?

Alvaro Miranda Aguilera

unread,
Jun 25, 2014, 5:16:14 AM6/25/14
to vagra...@googlegroups.com
Hello

From nginx manual:

Wildcard names

A wildcard name may contain an asterisk only on the name’s start or end, and only on a dot border. The names “www.*.example.org” and “w*.example.org” are invalid.

The name “*.example.org” matches not only www.example.org but www.sub.example.org as well.


So, reading this, in your example, can I suggest the following?:



??

you can put more than one server_name

Alvaro.


--
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages