nginx not forwarding requests to backend servers.

Brian Pugh project722 at gmail.com
Wed Jul 27 16:07:55 UTC 2016


Ok. This looks like progress. However it still fails. Here is my config as
it stands now.

in nginx.conf:

http {
   upstream myappliationsite.net {
       ip_hash;
       server backendappsite1.net;
       server backendappsite2.net;
       server backendappsite3.net;
   }

In default.conf:

server {

    listen       443 ssl;
    server_name  myapplicationsite.net;
    keepalive_timeout 70;

    ssl_certificate     /appssl/fd.crt;
    ssl_certificate_key /appssl/lb.key;
    ssl_protocols       TLSv1 TLSv1.1 TLSv1.2;
    ssl_ciphers         HIGH:!aNULL:!MD5;

     location / {
        proxy_pass   http://myapplicationsite.net;
        proxy_set_header HOST myapplicationsite.net;

    }
    }

And here is the errors I get:

On the web page:

502 bad gateway.

>From the logs:

 HTTP/1.1", upstream: *"http://192.168.155.120:80
<http://192.168.155.120:80>*/", host: "myapplicationsite.net"
2016/07/27 10:54:05 [warn] 27491#27491: *3 upstream server temporarily
disabled while connecting to upstream, client: 192.168.254.202, server:
myapplicationsite.net, request: "GET / HTTP/1.1", upstream:
"*http://192.168.155.120:80
<http://192.168.155.120:80>*/", host: "myapplicationsite.net"

Why is it trying to connect to my servers over port 80? I need to pass it
over on 443. How can I accomplish this? Even if I change the proxy pass to
https in the logs it still trys






On Wed, Jul 27, 2016 at 10:42 AM, Reinis Rozitis <r at roze.lv> wrote:

> 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?
>>
>
> It seems you have taken the default configuration example but if you use
> nginx as a balancer without serving any .php (or other) files you actually
> don't need those *.php etc locations  - a single location / {} will do the
> job (means all requests go to backends).
>
> For example:
>
>
> http {
>    upstream myappliationsite.net {
>        ip_hash;
>        server backendappsite1.net;
>        server backendappsite2.net;
>        server backendappsite3.net;
>    }
>
> server {
>    listen       80;
>    listen       443 ssl;
>
>   server_name myappliationsite.net;
>
>  location / {
>     proxy_pass   http://myappliationsite.net;
>     proxy_set_header HOST myappliationsite.net;
> }
> }
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20160727/538f0379/attachment.html>


More information about the nginx mailing list