<div dir="ltr"><span style="font-size:12.8px;background-color:rgb(255,255,255)"><font color="#ff0000">What request do you make of nginx?</font></span><br><div><span style="font-size:12.8px;background-color:rgb(255,255,255)"><br></span></div><div><span style="font-size:12.8px;background-color:rgb(255,255,255)">Requests come into nginx as <a href="https://myapplicationsite.net">https://myapplicationsite.net</a>"</span></div><div><span style="font-size:12.8px;background-color:rgb(255,255,255)"><br></span></div><div><span style="font-size:12.8px;background-color:rgb(255,255,255)">On the actual backend server, that request is then redirected to:</span></div><div><span style="font-size:12.8px;background-color:rgb(255,255,255)"><br></span></div><div><span style="font-size:12.8px;background-color:rgb(255,255,255)"><a href="https://myapplicationsite.net/">https://myapplicationsite.net/</a></span><span style="font-size:12.8px">/app/service/login?url=%2Fl</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">That brings up the login page on the backend server. </span></div><div><span style="font-size:12.8px"><br></span></div><div><font color="#ff0000"><span style="font-size:12.8px">Which of your defined location{} blocks does it match:</span><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">  location / {</span><br style="font-size:12.8px"><span style="font-size:12.8px">  location = /50x.html {</span><br style="font-size:12.8px"><span style="font-size:12.8px">  location ~ \.php$ {</span></font><span style="font-size:12.8px"><br></span></div><div><font color="#ff0000"><span style="font-size:12.8px"><br></span></font></div><div><span style="font-size:12.8px"><font color="#000000">This is another part I am not sure how to setup. Since I am not passing any php scripts I would have to say it matches the</font></span></div><div><span style="font-size:12.8px"><font color="#000000"><br></font></span></div><div><span style="font-size:12.8px"><font color="#000000">location /{} block. </font></span></div><div><br></div><div><font color="#000000"><span style="font-size:12.8px">So I have now modified that section of code to read:</span></font></div><div><font color="#000000"><span style="font-size:12.8px"><br></span></font></div><div><div>location / {</div><div>        #root   /usr/share/nginx/html;</div><div>        root    /app/service/login?url=%2Fl;</div><div>        index  index.html index.htm;</div><div>    }</div></div><div><br></div><div>And now, I get a different behavior once these changes are made. It now fails with a 404 not found and in the logs I see:</div><div><br></div><div><div>2016/07/27 10:06:46 [error] 26994#26994: *3 "/app/service/login?url=%2Fl/index.html" is not found (2: No such file or directory), client: 192.168.254.202, server: <a href="http://myapplicationsite.net">myapplicationsite.net</a>, request: "GET / HTTP/1.1", host: "<a href="http://myapplicationsite.net">myapplicationsite.net</a>"</div></div><div><br></div><div><font color="#ff0000"><span style="font-size:12.8px">It cannot guess what you want it to do.</span><br></font></div><div><br></div><div><font color="#000000">Right, I get that. I am a newb at nginx so I am looking for guidance on how to set all this up, which is why I posted my complete configs and described exactly what I wanted to accomplish. </font></div><div><font color="#000000"><br></font></div><div><font color="#000000">So, to recap, I have 3 backend servers that can accept connections using the following hostnames:</font></div><div><font color="#000000"><br></font></div><div><font color="#000000"><a href="http://backendappsite1.net">backendappsite1.net</a></font></div><div><font color="#000000"><a href="http://backendappsite2.net">backendappsite2.net</a></font></div><div><font color="#000000"><a href="http://backendappsite3.net">backendappsite3.net</a></font></div><div><font color="#000000"><br></font></div><div><font color="#000000">The hostname that maps to nginx is <a href="http://myapplicationsite.net">myapplicationsite.net</a>. What I want to happen is anytime a request for <a href="http://myapplicationsite.net">myapplicationsite.net</a> hits nginx, it get sent to one of the servers above in a round robin fashion. Can anyone give me an example config of what it would look like in both nginx.conf and default.conf using the names/info I have provided? </font></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 27, 2016 at 9:48 AM, Francis Daly <span dir="ltr"><<a href="mailto:francis@daoine.org" target="_blank">francis@daoine.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">On Wed, Jul 27, 2016 at 07:33:31AM -0500, Brian Pugh wrote:<br>
<br>
Hi there,<br>
<span class="gmail-"><br>
> I am using nginx as a load balancer. However when I type in the URL for my<br>
> site, which resolves to the IP of the load balancer, I get the default<br>
> nginx page saying "nginx has been setup more configuration is required". I<br>
> would expect nginx to forward my request through to the backend servers I<br>
> have defined.<br>
<br>
</span>What request do you make of nginx?<br>
<br>
Which of your defined location{} blocks does it match:<br>
<br>
  location / {<br>
  location = /50x.html {<br>
  location ~ \.php$ {<br>
<span class="gmail-"><br>
> And oddly enough, there is very little in the way of logging<br>
> going on, to tell me why its failing.<br>
<br>
</span>You wrote that it is returning some content, presumably with a http<br>
200. That suggests that it is not failing to do what you told it to do.<br>
<br>
It cannot guess what you want it to do.<br>
<span class="gmail-"><br>
>     Can anyone help my get requests to go to the backend servers? Is there<br>
<br>
</span>Try a request that ends with ".php" ?<br>
<br>
Use "curl -v" and copy-paste the output, if it is not what you expect.<br>
<span class="gmail-"><br>
> any other config or depenency apps needed that I may not have installed or<br>
> running? Also is there a way to enable more advanced debug logging to give<br>
> me a better idea whats going on?<br>
<br>
</span>There is the "debug log", which is "extra stuff written to the error log":<br>
<br>
<a href="http://nginx.org/en/docs/debugging_log.html" rel="noreferrer" target="_blank">http://nginx.org/en/docs/debugging_log.html</a><br>
<br>
Cheers,<br>
<br>
        f<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
Francis Daly        <a href="mailto:francis@daoine.org">francis@daoine.org</a><br>
</font></span><div class="gmail-HOEnZb"><div class="gmail-h5"><br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div></div>