Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Jetty 9: Named Connectors and Virtual Hosts

Here’s what I am trying to do. We are running a Railo server, and are building two independent but related web apps on the following domains:

 

·        *.ims-login.com: This is our actual Information Management System, a single Railo application handles all domains.

·        www.fluentims.com: This will be the public-facing website for our product.

 

This setup as of right now is working perfectly for subdomains of ims-login.com, however what we would now like to do is allow for customers to have their own domain pointed to our IP address. For example “ims.some-domain.org”.

 

Of course, this won’t be matched by the wildcard sub-domain because the TLD is different. So what we are doing is having a secondary IP (we have 2 static IPs on the VPS) dedicated to the ims-login.com area.

 

So basically, any and all requests on this IP address, regardless of the domain, or HTTP Host header, should be going to the ims-login.com web application.

 

I expected that simply having a named connector, and referencing that name by @ConnectorName as a virtual host would work. But the result is just a 404, because it is not going to the correct web application context.

 

From: jetty-users-bounces@xxxxxxxxxxx [mailto:jetty-users-bounces@xxxxxxxxxxx] On Behalf Of Joakim Erdfelt
Sent: June-07-13 12:05 PM
To: JETTY user mailing list
Subject: Re: [jetty-users] Jetty 9: Named Connectors and Virtual Hosts

 

What do you mean when you say ... 

 

"However, I am getting a HTTP 404 when I try to go to a random domain linked to the IMSConnector"?

 

Can you detail what you are doing, and what you are expecting?


--

Joakim Erdfelt <joakim@xxxxxxxxxxx>

Developer advice, services and support
from the Jetty & CometD experts

 

On Fri, Jun 7, 2013 at 8:38 AM, Shane Curless <shane@xxxxxxxxxxxxx> wrote:

Hello,

I am trying to set up a special configuration in Jetty whereby all requests
on a specific IP address go to a specific WebApp.

What I have done so far, is set up an extra HTTP connector named
"IMSConnector", to do this I have added the following test to
etc/jetty-http.xml:

<Call name="addConnector">
    <Arg>
      <New class="org.eclipse.jetty.server.ServerConnector">
        <Arg name="server"><Ref refid="Server" /></Arg>
        <Arg name="factories">
          <Array type="org.eclipse.jetty.server.ConnectionFactory">
            <Item>
              <New class="org.eclipse.jetty.server.HttpConnectionFactory">
                <Arg name="config"><Ref refid="httpConfig" /></Arg>
              </New>
            </Item>
          </Array>
        </Arg>
        <Set name="name">IMSConnector</Set>
        <Set name="host">127.0.0.2</Set>
        <Set name="port">8082</Set>
        <Set name="idleTimeout"><Property name="http.timeout"
default="30000"/></Set>
      </New>
    </Arg>
  </Call>

This appears to be working, as the log files show references to
"IMSConnector@...{127.0.0.2:8082}" and I can connect on that IP/Port both
via Telnet, and Nginx as a reverse-proxy.

I have the following in an XML file under webapps directory:

<Set name="virtualHosts">
    <Array type="String">
      <Item>@IMSConnector</Item>
      <Item>ims-login.com</Item>
      <Item>*.ims-login.com</Item>
    </Array>
  </Set>

According to the documentation, I should be able to use @IMSConnector to
answer all requests on that connector.
If I go to ims-login.com or anything.ims-login.com, it works exactly as it
should. However, I am getting a HTTP 404 when I try to go to a random domain
linked to the IMSConnector.

I use Nginx as a reverse-proxy, so requests on the external IP are proxied
to 127.0.0.2:8082 on the server.

I am certain this is nothing to do with Nginx, as connecting directly to
127.0.0.2:8082 via telnet and issuing a GET request has exactly the same
result.

Can anyone point out where I may be going wrong?

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jetty-users

 


Back to the top