Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] adding http ForwardRequestCustomizer from $JETTY_BASE

Note that this module already exist in jetty master branch, which adds the customizer

On 27 Jan 2016 2:05 am, "Simone Bordet" <sbordet@xxxxxxxxxxx> wrote:
Hi,

On Mon, Jan 25, 2016 at 6:37 PM, Jeremy Shapiro <jnshapiro@xxxxxxxxx> wrote:
> I have a reverse proxy in front of my server that is adding the headers.  I
> just want my app to process the headers using the
> org.eclipse.jetty.server.ForwardedRequestCustomizer customizer.  This works
> fine if I uncomment the stanza in jetty.xml's httpConfig.  But I would
> prefer not to have to modify that file.

Sure.

You want to make a small module file (say x-fwd.mod) with a dependency
on the "server" module that references a new XML file (say x-fwd.xml)
where you add the stanza that is commented out.

Then you enable the x-fwd module in your start.ini.

See https://www.eclipse.org/jetty/documentation/current/startup.html
for further details.

JETTY_BASE/modules/x-fwd.mod:
[depend]
server

[xml]
etc/x-fwd.xml
<<EOF

JETTY_BASE/etc/x-fwd.xml:
<Ref refid="httpConfig">
  <Call name="addCustomizer">
    <Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg>
  </Call>
</Ref>
<<EOF

JETTY_BASE/start.ini (diff):
+
+ --module=x-fwd
+

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.
_______________________________________________
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