My server displays a page with “502 Bad Gateway”Proxy HTTPS requests to a HTTP backend with NGINXNginx...

Rationale to prefer local variables over instance variables?

How to kill a localhost:8080

Has Wakanda ever accepted refugees?

Why would the IRS ask for birth certificates or even audit a small tax return?

I can't die. Who am I?

Who is NityA Devi Goddess

1970s scifi/horror novel where protagonist is used by a crablike creature to feed its larvae, goes mad, and is defeated by retraumatising him

How to create an associative array from two arrays?

Citing contemporaneous (interlaced?) preprints

Wardrobe above a wall with fuse boxes

A bug in Excel? Conditional formatting for marking duplicates also highlights unique value

How to disable or uninstall iTunes under High Sierra without disabling SIP

Is there a limit on the maximum number of future jobs queued in an org?

Change only a specific Default Parameter on a function

Are small insurances worth it

How do you say "powers of ten"?

Is there any relevance to Thor getting his hair cut other than comedic value?

How to use math.log10() function on whole pandas dataframe

When was drinking water recognized as crucial in marathon running?

How to fix my table, centering of columns

School performs periodic password audits. Is my password compromised?

Is there a frame of reference in which I was born before I was conceived?

If nine coins are tossed, what is the probability that the number of heads is even?

When do _WA_Sys_ statistics Get Updated?



My server displays a page with “502 Bad Gateway”


Proxy HTTPS requests to a HTTP backend with NGINXNginx has ssl module, but thinks it doesn'tNginx proxy pass works for https but not httpnginx proxy redirecting request to different proxyNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsNginX + WordPress + SSL + non-www + W3TC vhost config file questionsnginx reverse proxy hide login query also on 301 redirect or full qualified urlConfigure NGINX : How to handle 500 Error on upstream itself, While Nginx handle other 5xx errorsnginx-1.15.9 Variable support in “ssl_certificate” and “ssl_certificate_key” directives













0















I installed Netdata on my server by following this tutorial :



https://docs.netdata.cloud/docs/running-behind-nginx/



when I go on monitoring.example.com I have a page that displays "502 Bad Gateway".



If I go to http://xx.xx.xx.xxx:19999 the page appears and Netdata works.



I found an identical problem, but I did not understand the answer :



https://mondedie.fr/d/8073-resolu-nginx-https-sous-domaine-sickrage-502-bad-gateway



Here is the configuration of my server :



upstream backend {
server 127.0.0.1:19999;
keepalive 64;
}

server {
listen 80;
listen [::]:80;
server_name monitoring.example.com;

location / {
return 301 https://monitoring.example.com$request_uri;
}
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name monitoring.example.com;

auth_basic "Protected";
auth_basic_user_file /var/www/monitoring-example-com/web/.htpasswd;

ssl_certificate /etc/letsencrypt/live/monitoring.example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/monitoring.example.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://backend;
proxy_http_version 1.1;
proxy_pass_request_headers on;
proxy_set_header Connection "keep-alive";
proxy_store off;
}
}








share







New contributor




ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I installed Netdata on my server by following this tutorial :



    https://docs.netdata.cloud/docs/running-behind-nginx/



    when I go on monitoring.example.com I have a page that displays "502 Bad Gateway".



    If I go to http://xx.xx.xx.xxx:19999 the page appears and Netdata works.



    I found an identical problem, but I did not understand the answer :



    https://mondedie.fr/d/8073-resolu-nginx-https-sous-domaine-sickrage-502-bad-gateway



    Here is the configuration of my server :



    upstream backend {
    server 127.0.0.1:19999;
    keepalive 64;
    }

    server {
    listen 80;
    listen [::]:80;
    server_name monitoring.example.com;

    location / {
    return 301 https://monitoring.example.com$request_uri;
    }
    }

    server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
    server_name monitoring.example.com;

    auth_basic "Protected";
    auth_basic_user_file /var/www/monitoring-example-com/web/.htpasswd;

    ssl_certificate /etc/letsencrypt/live/monitoring.example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/monitoring.example.com/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

    location / {
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_pass http://backend;
    proxy_http_version 1.1;
    proxy_pass_request_headers on;
    proxy_set_header Connection "keep-alive";
    proxy_store off;
    }
    }








    share







    New contributor




    ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I installed Netdata on my server by following this tutorial :



      https://docs.netdata.cloud/docs/running-behind-nginx/



      when I go on monitoring.example.com I have a page that displays "502 Bad Gateway".



      If I go to http://xx.xx.xx.xxx:19999 the page appears and Netdata works.



      I found an identical problem, but I did not understand the answer :



      https://mondedie.fr/d/8073-resolu-nginx-https-sous-domaine-sickrage-502-bad-gateway



      Here is the configuration of my server :



      upstream backend {
      server 127.0.0.1:19999;
      keepalive 64;
      }

      server {
      listen 80;
      listen [::]:80;
      server_name monitoring.example.com;

      location / {
      return 301 https://monitoring.example.com$request_uri;
      }
      }

      server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2;
      server_name monitoring.example.com;

      auth_basic "Protected";
      auth_basic_user_file /var/www/monitoring-example-com/web/.htpasswd;

      ssl_certificate /etc/letsencrypt/live/monitoring.example.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/monitoring.example.com/privkey.pem;
      include /etc/letsencrypt/options-ssl-nginx.conf;
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

      location / {
      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-Server $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://backend;
      proxy_http_version 1.1;
      proxy_pass_request_headers on;
      proxy_set_header Connection "keep-alive";
      proxy_store off;
      }
      }








      share







      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I installed Netdata on my server by following this tutorial :



      https://docs.netdata.cloud/docs/running-behind-nginx/



      when I go on monitoring.example.com I have a page that displays "502 Bad Gateway".



      If I go to http://xx.xx.xx.xxx:19999 the page appears and Netdata works.



      I found an identical problem, but I did not understand the answer :



      https://mondedie.fr/d/8073-resolu-nginx-https-sous-domaine-sickrage-502-bad-gateway



      Here is the configuration of my server :



      upstream backend {
      server 127.0.0.1:19999;
      keepalive 64;
      }

      server {
      listen 80;
      listen [::]:80;
      server_name monitoring.example.com;

      location / {
      return 301 https://monitoring.example.com$request_uri;
      }
      }

      server {
      listen 443 ssl http2;
      listen [::]:443 ssl http2;
      server_name monitoring.example.com;

      auth_basic "Protected";
      auth_basic_user_file /var/www/monitoring-example-com/web/.htpasswd;

      ssl_certificate /etc/letsencrypt/live/monitoring.example.com/fullchain.pem;
      ssl_certificate_key /etc/letsencrypt/live/monitoring.example.com/privkey.pem;
      include /etc/letsencrypt/options-ssl-nginx.conf;
      ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

      location / {
      proxy_set_header X-Forwarded-Host $host;
      proxy_set_header X-Forwarded-Server $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://backend;
      proxy_http_version 1.1;
      proxy_pass_request_headers on;
      proxy_set_header Connection "keep-alive";
      proxy_store off;
      }
      }






      nginx virtualhost ip reverse-proxy 500-error





      share







      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 6 mins ago









      ML19ML19

      174




      174




      New contributor




      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      ML19 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "2"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });






          ML19 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f957078%2fmy-server-displays-a-page-with-502-bad-gateway%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          ML19 is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          ML19 is a new contributor. Be nice, and check out our Code of Conduct.













          ML19 is a new contributor. Be nice, and check out our Code of Conduct.












          ML19 is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Server Fault!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f957078%2fmy-server-displays-a-page-with-502-bad-gateway%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...