[Seaside] Re: Nginx Reverse Proxying

Paul DeBruicker pdebruic at gmail.com
Thu Dec 12 19:15:38 UTC 2013


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.


More information about the seaside mailing list