<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Dec 12, 2013 at 8:39 PM, Esteban A. Maringolo <span dir="ltr">&lt;<a href="mailto:emaringolo@gmail.com" target="_blank">emaringolo@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Also, looking at Davorin example I see a lot of &quot;tweaks&quot; for Proxy<br>

module, many of which must respond to particular tunings I guess, but<br>
there are a few that<br>
<br>
What is this for?<br>
proxy_redirect          off;<br>
<br></blockquote><div><br></div><div>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:</div>
<div><br></div><div><a href="http://www.cyberciti.biz/faq/proxy_redirect-change-replace-location-refresh-response-headers/">http://www.cyberciti.biz/faq/proxy_redirect-change-replace-location-refresh-response-headers/</a></div>
<div><br></div><div>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.</div>
<div><br></div><div>davorin</div><div><a href="http://www.cloud208.com/">http://www.cloud208.com/</a></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

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