Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] ForwardedSchemeHeaderRule problems in Jetty 8.1.8

Hi All,

We've recently upgraded from Jetty 6.1.24 to 8.1.8, porting some custom configuration as we went. I'm having some problems getting the ForwardedSchemeHeaderRule which sat in the jetty.xml working however (in bold below - the bit below it is working fine in the jetty.xml). I've played with putting this in the jetty-rewrite.xml instead but that doesn't appear to have helped. Does anyone have any suggestions please?

    <!-- =========================================================== -->
    <!-- Configure Rewrite Handler                       
            -->
    <!-- ==============================
============================= -->
    <Set name="handler">
        <New id="Handlers" class="org.eclipse.jetty.
rewrite.handler.RewriteHandler">
            <Set name="rules">
                <Array type="org.eclipse.jetty.
rewrite.handler.Rule">
                    <Item>
                        <New id="forwardedHttps"
                            class="org.eclipse.jetty.
rewrite.handler.ForwardedSchemeHeaderRule">

                            <!-- If this header is present, and the specified headerValue matches,
                              
   then the specified scheme will be passed on. If the headerValue isn't
                              
   specified, then the presence of the header with any value will trigger
                              
   the scheme modification.
                            -->
                            <Set name="header">X-Forwarded-
Scheme</Set>
                            <Set name="headerValue">https</Set>
                            <Set name="scheme">https</Set>
                        </New>
                    </Item>
                </Array>
            </Set>

            <Set name="handler">
                <New id="Handlers" class="org.eclipse.jetty.
server.handler.HandlerCollection">
                    <Set name="handlers">
                        <Array type="org.eclipse.jetty.
server.Handler">
                            <Item><Ref id="Contexts"/></Item>
                            <Item><New id="DefaultHandler" class="org.eclipse.jetty.
server.handler.DefaultHandler"/></Item>
                            <Item><New id="RequestLog" class="org.eclipse.jetty.
server.handler.RequestLogHandler"/></Item>
                        </Array>
                    </Set>
                </New>
            </Set>
        </New>
    </Set>


Thanks,

Tom

Back to the top