[Seaside] Re: Nginx Reverse Proxying

Davorin Rusevljan davorin.rusevljan at gmail.com
Thu Dec 12 19:52:52 UTC 2013


On Thu, Dec 12, 2013 at 8:39 PM, Esteban A. Maringolo
<emaringolo at gmail.com>wrote:

> Also, looking at Davorin example I see a lot of "tweaks" for Proxy
> module, many of which must respond to particular tunings I guess, but
> there are a few that
>
> What is this for?
> proxy_redirect          off;
>
>
As I said my configuration might be a bit rotten, so I am not sure this is
necessary, and maybe even wrong. It deals with rewriting urls in responses
from server, this just states that all locations returned by the server
will be returned as is, and not rewritten by nginx in any way. Docs:

http://www.cyberciti.biz/faq/proxy_redirect-change-replace-location-refresh-response-headers/

On the other point, I would be a bit weary of proxying WebSockets, and I
would be interested if it worked ok for you, and how. Maybe you would need
to pay some attention to it in config, and/or use newer version of nginx to
make it work.

davorin
http://www.cloud208.com/



> I guess this could be useful to get extra datta at the server side:
>             proxy_set_header        host $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-host $host;
>             proxy_set_header        x-forwarded-port $server_port;
>
> This must have to do to prevent Seaside/Zinc from getting excessively
> big requests.
>             client_max_body_size    10m;
>             client_body_buffer_size 128k;
>
> This I can understand :)
>             proxy_connect_timeout   90;
>             proxy_send_timeout      90;
>             proxy_read_timeout      90;
>
>
> But then you se proxy_redirect again!
>             proxy_redirect  default;
>
>
> Regards!
>
> Esteban A. Maringolo
>
>
> 2013/12/12 Paul DeBruicker <pdebruic at gmail.com>:
> > You can do all those things from one nginx configuration file.
> >
> > see the proxy and rewrite docs here:
> >
> > http://nginx.org/en/docs/
> >
> >
> > as a guess you want something like:
> >
> > upstream seaside {
> >     server 127.0.0.1:8080;
> > }
> > upstream ws {
> >     server 127.0.0.1:8081;
> > }
> >
> > server {
> >      server_name app01.mydomain.com;
> >      root /var/www/mydomain.com;
> >      location @myApp{
> >           proxy_pass http://seaside;
> >      }
> >      location /app{
> >           try_files $uri @myApp;
> >      }
> > }
> >
> > server {
> >      server_name ws01.mydomain.com;
> >      location / {
> >           proxy_pass http://ws;
> >      }
> > }
> >
> >
> > Hope this helps.
> >
> >
> > Paul
> >
> >
> >
> >
> > Esteban A. Maringolo wrote
> >> Hi there,
> >>
> >> I continue with my server setup...
> >>
> >> I'm trying to setup nginx as the HTTP front end.
> >>
> >> I have two servers, one for the Zinc SeasideAdaptor running on 8080
> >> and another server running on 8081 (maybe there is a way to run both
> >> on the same server).
> >>
> >> ZnZincServerAdaptor  startOn: 8080.
> >> ZnServer startDefaultOn: 8081.
> >> ZnServer default delegate: (ZnWebSocketDelegate map: 'ws' to:
> MyWsHandler
> >> new).
> >>
> >> In the Seaside side I have three "entry points":
> >> /app  : which is a standard Seaside application
> >> /app-api/v1/ :which is a WARestfulHandler (REST API, with Basic HTTP
> Auth)
> >> /assets (File Directory for static files)
> >>
> >> I plan to put a nginx in front of those services, mainly for
> >> performance purpose of static file serving, and to avoid the exposure
> >> of my server directy to internet.
> >>
> >> Supposing the hostname is app01.mydomain.com ?
> >>
> >> My requirements are
> >>
> >> 1) I want that http://app01.mydomain.com/app be forwarded to
> >> http://localhost:8080/app, the same with app-api
> >> 2) Same for websockets, maybe to http://ws01.mydomain.com to
> >> http://localhost:8081/ws
> >> 3) http://app01.mydomain.com/assets be served statically.
> >>
> >> I know this is a request which isn't directly related with Pharo nor
> >> Seaside, but given the fact it's a common setup I hope somebody will
> >> help me with this. Sorry for the crosspost.
> >>
> >> Regards,
> >>
> >>
> >>
> >> Esteban A. Maringolo
> >> _______________________________________________
> >> seaside mailing list
> >
> >> seaside at .squeakfoundation
> >
> >> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
> >
> >
> >
> > --
> > View this message in context:
> http://forum.world.st/Nginx-Reverse-Proxying-tp4729686p4729694.html
> > Sent from the Seaside General mailing list archive at Nabble.com.
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20131212/f9c2fbbd/attachment-0001.htm


More information about the seaside mailing list