Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] nginx as a reverse proxy?

This may help, depending on what the applications is doing:
In jetty you want to turn of the forwarded for request customizer, either by adding --module=http-forwarded on every start, or do a --add-to-startd=http-forwarded once

This will interpret the forwarded for headers and may help jetty interpret the proxy.  You may want to check the start.d/http-forwarded.ini file for configuration options (using the second method above)

cheers



On 4 April 2016 at 21:14, Bjørn T Johansen <btj@xxxxxxxxxx> wrote:
Yes, I am trying to move my webapplications that currently runs on Tomcat over to Jetty. So now I am trying with the first one. (And everything works
as it should using nginx and tomcat).

The location section looks like this:


upstream appserver02 {
  server 10.x.x.x:8081 fail_timeout=0;
}

location  / {
                        proxy_redirect off;
                        proxy_pass      http://appserver02;
                        rewrite_log     off;

                        proxy_set_header Host             $host;
                        proxy_set_header X-Forwarded-Host $host;
                        proxy_set_header X-Forwarded-By $host;
                        proxy_set_header X-Real-IP      $remote_addr;
                        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                        proxy_set_header X-Forwarded-Proto https;
                        proxy_set_header X-Scheme $scheme;

                        proxy_connect_timeout      30;
                        proxy_send_timeout         15;
                        proxy_read_timeout         15;

                        proxy_buffer_size                4k;
                        proxy_buffers                 4 32k;
                        proxy_busy_buffers_size         64k;
                        proxy_temp_file_write_size      64k;

                        proxy_next_upstream error timeout http_502 http_503 http_504;
                        error_page   502 503 504   http://www.domain.no/down.html;

                        proxy_max_temp_file_size 0;

                        client_max_body_size    20m;
                        client_body_buffer_size 128k;

                }


BTJ

On Mon, 4 Apr 2016 08:36:15 +1000
Ted McFadden <ted@xxxxxxxxxxxxxx> wrote:

> Hi,
>
> What does your nginx config 'location' section look like for the jetty
> proxy? And aside from the jetty proxy, https content is served ok from
> nginx?
>
> Cheers,
>
> Ted
>
>
> Ted McFadden
> Chief Engineer
>
> Leximancer Pty Ltd
> Brisbane, Queensland,  Australia,
> ACN: 116 218 109
>
> http://info.leximancer.com
>
>
>
>
> On 3 April 2016 at 23:41, Bjørn T Johansen <btj@xxxxxxxxxx> wrote:
>
> > I have setup virtual host on my Jetty and using nginx in front of it works
> > as it should, as long as I am using http. When I use https that is
> > terminated on my nginx server, Jetty does not respond anymore (I get an
> > http error 503 from nginx).
> >
> > I have the following context file on my Jetty server:
> >
> > <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "
> > http://www.eclipse.org/jetty/configure_9_0.dtd">
> >
> > <Configure class="org.eclipse.jetty.webapp.WebAppContext">
> >   <Set name="contextPath">/</Set>
> >   <Set name="war">/opt/webapps/application.war</Set>
> >   <Set name="virtualHosts">
> >     <Array type="java.lang.String">
> >       <Item>www.domain.no</Item>
> >     </Array>
> >   </Set>
> > </Configure>
> >
> > Are there any particular config I am missing from Jetty to make this work
> > or?
> >
> >
> > Regards,
> >
> > BTJ
> >
> > --
> >
> > -----------------------------------------------------------------------------------------------
> > Bjørn T Johansen
> >
> > btj@xxxxxxxxxx
> >
> > -----------------------------------------------------------------------------------------------
> > Someone wrote:
> > "I understand that if you play a Windows CD backwards you hear strange
> > Satanic messages"
> > To which someone replied:
> > "It's even worse than that; play it forwards and it installs Windows"
> >
> > -----------------------------------------------------------------------------------------------
> > _______________________________________________
> > 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


_______________________________________________
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