Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] MovedContextHandler

MovedContextHandler is an implementation of ContextHandler, which supports virtualhosts.

You can either setup the virtualHosts by incoming host (like you are doing), or via the alternate syntax of @name which uses named connectors.

Your connector has a name assigned (your choice of name, just keep it simple alphanumeric without punctuation and whitespace).
Lets say you picked "oldClients" as a name for the Connector.
Then your virtualHosts configuration would use "@oldClients" in its entries to only use that Connector for processing the moved context.

Joakim Erdfelt / joakim@xxxxxxxxxxx

On Thu, Jan 28, 2016 at 3:44 PM, Eric Nissan <eric.nissan@xxxxxxxxx> wrote:
Is there a way to have the MovedContextHandler only respond if the request comes in from a specific port?

I am using a load balancer.  I need to direct all non secure traffic to a secure port on the load balancer.
but I also am trying to redirect all non www traffic to www.

<Configure class="org.eclipse.jetty.server.handler.MovedContextHandler">
  <Set name="contextPath">/</Set>
  <Set name="newContextURL">https://www.mydomain.com</Set>
  <Set name="permanent">true</Set>
  <Set name="discardPathInfo">false</Set>
  <Set name="discardQuery">false</Set>
  <Set name="virtualHosts">
    <Array type="String">
          <Item>mydomain.com</Item>
    </Array>
  </Set>
</Configure>

Thanks.
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


Back to the top