[Seaside] Re: Nginx Reverse Proxying
Esteban A. Maringolo
emaringolo at gmail.com
Thu Dec 12 19:39:33 UTC 2013
Thanks people. I managed to get something working helped by
http://www.monkeysnatchbanana.com/posts/2010/06/23/reverse-proxying-to-seaside-with-nginx.html
But looking at the upstream module it seems like a good feature to
handle failover servers.
I don't understand the @myApp syntax. What is the @ for?
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;
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
More information about the seaside
mailing list