Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Virtual hosts and wildcards

The VirtualHost wildcard behavior is for domain names only (not IP addresses), and the string must start with "*.", there's no support for trailing wildcard.

Virtual Hosts based on IP address is usually an anti-pattern that is better addressed using @named virtualhosts to establish the Context Handler to the specific named Connector.

Like this ...

Connector(Address).setName("personal");
ContextHandler().addVirtualHost("@personal");

Joakim Erdfelt / joakim@xxxxxxxxxxx


On Wed, Aug 11, 2021 at 1:25 PM John English <john.foreign@xxxxxxxxx> wrote:
I have a webapp set up to respond to a wildcarded domain and some local
IP addresses, which I use to connect to a warm backup locally and bring
it online when necessary, or to use local test rigs without having to
have multiple configuration files:

   <Set name="virtualHosts">
     <Array type="java.lang.String">
       <Item>*.foo.com</Item>
       <Item>10.0.0.200</Item>
       <Item>10.0.0.201</Item>
       <Item>10.0.0.210</Item>
       <Item>10.0.0.211</Item>
       <Item>10.0.0.240</Item>
       <Item>127.0.0.1</Item>
     </Array>
   </Set>

Is there any way to wildcard IP addresses? I can't seem to get 10.0.0.*
to work, so have to put a list of relevant local net addresses instead.
And of course I can't use DHCP for any of the test rigs either.

Thanks,
--
John English
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top