Nginx not available from localhost, but available by network

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












Have server with installed nginx and php-fpm. Some sctript need access to part of site via curl. But it fails. I tried to run curl on server :



curl -v -i alexcoder.info
* About to connect() to alexcoder.info port 80 (#0)
* Trying 88.198.156.238...
* Connection refused
* couldn't connect to host
* Closing connection #0
curl: (7) couldn't connect to host


But from network sites available :



curl -v -i alexcoder.info
* Rebuilt URL to: alexcoder.info/
* Adding handle: conn: 0x702b10
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x702b10) send_pipe: 1, recv_pipe: 0
* About to connect() to alexcoder.info port 80 (#0)
* Trying 88.198.156.238...
* Connected to alexcoder.info (88.198.156.238) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.32.0
> Host: alexcoder.info
> Accept: */*
>
< HTTP/1.1 200 OK


HTTP/1.1 200 OK



nginx logs does not contain any errors aboout this. I tried to flush iptables rules but it take no effect.



What it may be?










share|improve this question

























    up vote
    2
    down vote

    favorite












    Have server with installed nginx and php-fpm. Some sctript need access to part of site via curl. But it fails. I tried to run curl on server :



    curl -v -i alexcoder.info
    * About to connect() to alexcoder.info port 80 (#0)
    * Trying 88.198.156.238...
    * Connection refused
    * couldn't connect to host
    * Closing connection #0
    curl: (7) couldn't connect to host


    But from network sites available :



    curl -v -i alexcoder.info
    * Rebuilt URL to: alexcoder.info/
    * Adding handle: conn: 0x702b10
    * Adding handle: send: 0
    * Adding handle: recv: 0
    * Curl_addHandleToPipeline: length: 1
    * - Conn 0 (0x702b10) send_pipe: 1, recv_pipe: 0
    * About to connect() to alexcoder.info port 80 (#0)
    * Trying 88.198.156.238...
    * Connected to alexcoder.info (88.198.156.238) port 80 (#0)
    > GET / HTTP/1.1
    > User-Agent: curl/7.32.0
    > Host: alexcoder.info
    > Accept: */*
    >
    < HTTP/1.1 200 OK


    HTTP/1.1 200 OK



    nginx logs does not contain any errors aboout this. I tried to flush iptables rules but it take no effect.



    What it may be?










    share|improve this question























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Have server with installed nginx and php-fpm. Some sctript need access to part of site via curl. But it fails. I tried to run curl on server :



      curl -v -i alexcoder.info
      * About to connect() to alexcoder.info port 80 (#0)
      * Trying 88.198.156.238...
      * Connection refused
      * couldn't connect to host
      * Closing connection #0
      curl: (7) couldn't connect to host


      But from network sites available :



      curl -v -i alexcoder.info
      * Rebuilt URL to: alexcoder.info/
      * Adding handle: conn: 0x702b10
      * Adding handle: send: 0
      * Adding handle: recv: 0
      * Curl_addHandleToPipeline: length: 1
      * - Conn 0 (0x702b10) send_pipe: 1, recv_pipe: 0
      * About to connect() to alexcoder.info port 80 (#0)
      * Trying 88.198.156.238...
      * Connected to alexcoder.info (88.198.156.238) port 80 (#0)
      > GET / HTTP/1.1
      > User-Agent: curl/7.32.0
      > Host: alexcoder.info
      > Accept: */*
      >
      < HTTP/1.1 200 OK


      HTTP/1.1 200 OK



      nginx logs does not contain any errors aboout this. I tried to flush iptables rules but it take no effect.



      What it may be?










      share|improve this question













      Have server with installed nginx and php-fpm. Some sctript need access to part of site via curl. But it fails. I tried to run curl on server :



      curl -v -i alexcoder.info
      * About to connect() to alexcoder.info port 80 (#0)
      * Trying 88.198.156.238...
      * Connection refused
      * couldn't connect to host
      * Closing connection #0
      curl: (7) couldn't connect to host


      But from network sites available :



      curl -v -i alexcoder.info
      * Rebuilt URL to: alexcoder.info/
      * Adding handle: conn: 0x702b10
      * Adding handle: send: 0
      * Adding handle: recv: 0
      * Curl_addHandleToPipeline: length: 1
      * - Conn 0 (0x702b10) send_pipe: 1, recv_pipe: 0
      * About to connect() to alexcoder.info port 80 (#0)
      * Trying 88.198.156.238...
      * Connected to alexcoder.info (88.198.156.238) port 80 (#0)
      > GET / HTTP/1.1
      > User-Agent: curl/7.32.0
      > Host: alexcoder.info
      > Accept: */*
      >
      < HTTP/1.1 200 OK


      HTTP/1.1 200 OK



      nginx logs does not contain any errors aboout this. I tried to flush iptables rules but it take no effect.



      What it may be?







      php nginx






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 26 '14 at 21:41









      alexgauss1994

      6317




      6317




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Multiple servers



          You need to setup a listener for each network interface you want Nginx to respond to:



          server {
          listen 80;
          server_name localhost;

          #charset koi8-r;

          #access_log logs/host.access.log main;

          location /
          root html;
          index index.html index.htm;



          You likely already have a server .. section that's listening on the actual interface that your system binds to when it gets an IP address.



          Multiple listeners



          You can also add multiple Listen lines to a server .. section like so:



          Examples



          listen *:80;


          or



          listen localhost:80;
          listen 127.0.0.1:80;
          listen 12.34.56.78:80;



          I would likely do it using this second method! See this article for more examples, titled: - Basic Nginx Configuration.



          References



          • Server Names - Nginx Documentation

          • Server Block Examples

          • NGINX multiple server blocks with reverse proxy

          • Basic Nginx Configuration





          share|improve this answer






















          • @alexgauss1994 - yup, thanks for the Q!
            – slm
            Feb 26 '14 at 22:16

















          up vote
          -1
          down vote













          I have also facing same issue. I have configure the file in sites-enabled. The file configuration is given below.
          upstream backend
          server localhost:3000;



          we're in the http context here



          map $http_upgrade $connection_upgrade



          # default upgrade;
          # '' close;





          server



          listen 81 default_server;



          # listen [::]:81 default_server;



          listen 80; 
          server_name track.xxxxxxxxxx.com;
          server_tokens off;
          return 301 https://$host$request_uri;




          the secure nginx server instance



          server



          # listen 443 ssl;
          # ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
          # ssl_certificate_key /etc/ssl/private/
          .domainName.1.key;
          #server_name xyz;
          # location /
          # proxy_set_header X-Real-IP $remote_addr;
          # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          # proxy_set_header Host $http_host;
          # proxy_http_version 1.1;
          # proxy_set_header Upgrade $http_upgrade;
          # proxy_set_header Connection $connection_upgrade;
          # proxy_set_header X-NginX-Proxy true;
          # proxy_set_header X-Ssl on;
          # proxy_pass http://localhost:3000;
          # proxy_redirect off;
          #





          the secure nginx server instance



          server
          listen 443 ssl;
          ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
          ssl_certificate_key /etc/ssl/private/
          .domain.1.key;



          listen 80 default_server;



          server_name track.xxxxxxxxxx.com;



          server_name _;



           location / 
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          proxy_set_header Host $http_host;
          proxy_set_header X-NginX-Proxy true;
          proxy_set_header X-Ssl on;
          proxy_pass http://localhost:3000;
          proxy_redirect off;





          server
          listen 7003;
          server_name localhost;
          root /opt/ClientFolder/;
          location /
          try_files $uri @backend;



          location @backend 
          proxy_pass https://backend;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header Host $host;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
          # Following is necessary for Websocket support
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection "upgrade";





          Please do needful.






          share|improve this answer








          New contributor




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

















            Your Answer








            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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',
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            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
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f117128%2fnginx-not-available-from-localhost-but-available-by-network%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote



            accepted










            Multiple servers



            You need to setup a listener for each network interface you want Nginx to respond to:



            server {
            listen 80;
            server_name localhost;

            #charset koi8-r;

            #access_log logs/host.access.log main;

            location /
            root html;
            index index.html index.htm;



            You likely already have a server .. section that's listening on the actual interface that your system binds to when it gets an IP address.



            Multiple listeners



            You can also add multiple Listen lines to a server .. section like so:



            Examples



            listen *:80;


            or



            listen localhost:80;
            listen 127.0.0.1:80;
            listen 12.34.56.78:80;



            I would likely do it using this second method! See this article for more examples, titled: - Basic Nginx Configuration.



            References



            • Server Names - Nginx Documentation

            • Server Block Examples

            • NGINX multiple server blocks with reverse proxy

            • Basic Nginx Configuration





            share|improve this answer






















            • @alexgauss1994 - yup, thanks for the Q!
              – slm
              Feb 26 '14 at 22:16














            up vote
            2
            down vote



            accepted










            Multiple servers



            You need to setup a listener for each network interface you want Nginx to respond to:



            server {
            listen 80;
            server_name localhost;

            #charset koi8-r;

            #access_log logs/host.access.log main;

            location /
            root html;
            index index.html index.htm;



            You likely already have a server .. section that's listening on the actual interface that your system binds to when it gets an IP address.



            Multiple listeners



            You can also add multiple Listen lines to a server .. section like so:



            Examples



            listen *:80;


            or



            listen localhost:80;
            listen 127.0.0.1:80;
            listen 12.34.56.78:80;



            I would likely do it using this second method! See this article for more examples, titled: - Basic Nginx Configuration.



            References



            • Server Names - Nginx Documentation

            • Server Block Examples

            • NGINX multiple server blocks with reverse proxy

            • Basic Nginx Configuration





            share|improve this answer






















            • @alexgauss1994 - yup, thanks for the Q!
              – slm
              Feb 26 '14 at 22:16












            up vote
            2
            down vote



            accepted







            up vote
            2
            down vote



            accepted






            Multiple servers



            You need to setup a listener for each network interface you want Nginx to respond to:



            server {
            listen 80;
            server_name localhost;

            #charset koi8-r;

            #access_log logs/host.access.log main;

            location /
            root html;
            index index.html index.htm;



            You likely already have a server .. section that's listening on the actual interface that your system binds to when it gets an IP address.



            Multiple listeners



            You can also add multiple Listen lines to a server .. section like so:



            Examples



            listen *:80;


            or



            listen localhost:80;
            listen 127.0.0.1:80;
            listen 12.34.56.78:80;



            I would likely do it using this second method! See this article for more examples, titled: - Basic Nginx Configuration.



            References



            • Server Names - Nginx Documentation

            • Server Block Examples

            • NGINX multiple server blocks with reverse proxy

            • Basic Nginx Configuration





            share|improve this answer














            Multiple servers



            You need to setup a listener for each network interface you want Nginx to respond to:



            server {
            listen 80;
            server_name localhost;

            #charset koi8-r;

            #access_log logs/host.access.log main;

            location /
            root html;
            index index.html index.htm;



            You likely already have a server .. section that's listening on the actual interface that your system binds to when it gets an IP address.



            Multiple listeners



            You can also add multiple Listen lines to a server .. section like so:



            Examples



            listen *:80;


            or



            listen localhost:80;
            listen 127.0.0.1:80;
            listen 12.34.56.78:80;



            I would likely do it using this second method! See this article for more examples, titled: - Basic Nginx Configuration.



            References



            • Server Names - Nginx Documentation

            • Server Block Examples

            • NGINX multiple server blocks with reverse proxy

            • Basic Nginx Configuration






            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited May 23 '17 at 12:40









            Community

            1




            1










            answered Feb 26 '14 at 22:01









            slm

            245k66505671




            245k66505671











            • @alexgauss1994 - yup, thanks for the Q!
              – slm
              Feb 26 '14 at 22:16
















            • @alexgauss1994 - yup, thanks for the Q!
              – slm
              Feb 26 '14 at 22:16















            @alexgauss1994 - yup, thanks for the Q!
            – slm
            Feb 26 '14 at 22:16




            @alexgauss1994 - yup, thanks for the Q!
            – slm
            Feb 26 '14 at 22:16












            up vote
            -1
            down vote













            I have also facing same issue. I have configure the file in sites-enabled. The file configuration is given below.
            upstream backend
            server localhost:3000;



            we're in the http context here



            map $http_upgrade $connection_upgrade



            # default upgrade;
            # '' close;





            server



            listen 81 default_server;



            # listen [::]:81 default_server;



            listen 80; 
            server_name track.xxxxxxxxxx.com;
            server_tokens off;
            return 301 https://$host$request_uri;




            the secure nginx server instance



            server



            # listen 443 ssl;
            # ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
            # ssl_certificate_key /etc/ssl/private/
            .domainName.1.key;
            #server_name xyz;
            # location /
            # proxy_set_header X-Real-IP $remote_addr;
            # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            # proxy_set_header Host $http_host;
            # proxy_http_version 1.1;
            # proxy_set_header Upgrade $http_upgrade;
            # proxy_set_header Connection $connection_upgrade;
            # proxy_set_header X-NginX-Proxy true;
            # proxy_set_header X-Ssl on;
            # proxy_pass http://localhost:3000;
            # proxy_redirect off;
            #





            the secure nginx server instance



            server
            listen 443 ssl;
            ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
            ssl_certificate_key /etc/ssl/private/
            .domain.1.key;



            listen 80 default_server;



            server_name track.xxxxxxxxxx.com;



            server_name _;



             location / 
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
            proxy_set_header X-Ssl on;
            proxy_pass http://localhost:3000;
            proxy_redirect off;





            server
            listen 7003;
            server_name localhost;
            root /opt/ClientFolder/;
            location /
            try_files $uri @backend;



            location @backend 
            proxy_pass https://backend;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            # Following is necessary for Websocket support
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";





            Please do needful.






            share|improve this answer








            New contributor




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





















              up vote
              -1
              down vote













              I have also facing same issue. I have configure the file in sites-enabled. The file configuration is given below.
              upstream backend
              server localhost:3000;



              we're in the http context here



              map $http_upgrade $connection_upgrade



              # default upgrade;
              # '' close;





              server



              listen 81 default_server;



              # listen [::]:81 default_server;



              listen 80; 
              server_name track.xxxxxxxxxx.com;
              server_tokens off;
              return 301 https://$host$request_uri;




              the secure nginx server instance



              server



              # listen 443 ssl;
              # ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
              # ssl_certificate_key /etc/ssl/private/
              .domainName.1.key;
              #server_name xyz;
              # location /
              # proxy_set_header X-Real-IP $remote_addr;
              # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              # proxy_set_header Host $http_host;
              # proxy_http_version 1.1;
              # proxy_set_header Upgrade $http_upgrade;
              # proxy_set_header Connection $connection_upgrade;
              # proxy_set_header X-NginX-Proxy true;
              # proxy_set_header X-Ssl on;
              # proxy_pass http://localhost:3000;
              # proxy_redirect off;
              #





              the secure nginx server instance



              server
              listen 443 ssl;
              ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
              ssl_certificate_key /etc/ssl/private/
              .domain.1.key;



              listen 80 default_server;



              server_name track.xxxxxxxxxx.com;



              server_name _;



               location / 
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              proxy_set_header Host $http_host;
              proxy_set_header X-NginX-Proxy true;
              proxy_set_header X-Ssl on;
              proxy_pass http://localhost:3000;
              proxy_redirect off;





              server
              listen 7003;
              server_name localhost;
              root /opt/ClientFolder/;
              location /
              try_files $uri @backend;



              location @backend 
              proxy_pass https://backend;
              proxy_set_header X-Real-IP $remote_addr;
              proxy_set_header Host $host;
              proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
              # Following is necessary for Websocket support
              proxy_http_version 1.1;
              proxy_set_header Upgrade $http_upgrade;
              proxy_set_header Connection "upgrade";





              Please do needful.






              share|improve this answer








              New contributor




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



















                up vote
                -1
                down vote










                up vote
                -1
                down vote









                I have also facing same issue. I have configure the file in sites-enabled. The file configuration is given below.
                upstream backend
                server localhost:3000;



                we're in the http context here



                map $http_upgrade $connection_upgrade



                # default upgrade;
                # '' close;





                server



                listen 81 default_server;



                # listen [::]:81 default_server;



                listen 80; 
                server_name track.xxxxxxxxxx.com;
                server_tokens off;
                return 301 https://$host$request_uri;




                the secure nginx server instance



                server



                # listen 443 ssl;
                # ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
                # ssl_certificate_key /etc/ssl/private/
                .domainName.1.key;
                #server_name xyz;
                # location /
                # proxy_set_header X-Real-IP $remote_addr;
                # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                # proxy_set_header Host $http_host;
                # proxy_http_version 1.1;
                # proxy_set_header Upgrade $http_upgrade;
                # proxy_set_header Connection $connection_upgrade;
                # proxy_set_header X-NginX-Proxy true;
                # proxy_set_header X-Ssl on;
                # proxy_pass http://localhost:3000;
                # proxy_redirect off;
                #





                the secure nginx server instance



                server
                listen 443 ssl;
                ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
                ssl_certificate_key /etc/ssl/private/
                .domain.1.key;



                listen 80 default_server;



                server_name track.xxxxxxxxxx.com;



                server_name _;



                 location / 
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-NginX-Proxy true;
                proxy_set_header X-Ssl on;
                proxy_pass http://localhost:3000;
                proxy_redirect off;





                server
                listen 7003;
                server_name localhost;
                root /opt/ClientFolder/;
                location /
                try_files $uri @backend;



                location @backend 
                proxy_pass https://backend;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                # Following is necessary for Websocket support
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";





                Please do needful.






                share|improve this answer








                New contributor




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









                I have also facing same issue. I have configure the file in sites-enabled. The file configuration is given below.
                upstream backend
                server localhost:3000;



                we're in the http context here



                map $http_upgrade $connection_upgrade



                # default upgrade;
                # '' close;





                server



                listen 81 default_server;



                # listen [::]:81 default_server;



                listen 80; 
                server_name track.xxxxxxxxxx.com;
                server_tokens off;
                return 301 https://$host$request_uri;




                the secure nginx server instance



                server



                # listen 443 ssl;
                # ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
                # ssl_certificate_key /etc/ssl/private/
                .domainName.1.key;
                #server_name xyz;
                # location /
                # proxy_set_header X-Real-IP $remote_addr;
                # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                # proxy_set_header Host $http_host;
                # proxy_http_version 1.1;
                # proxy_set_header Upgrade $http_upgrade;
                # proxy_set_header Connection $connection_upgrade;
                # proxy_set_header X-NginX-Proxy true;
                # proxy_set_header X-Ssl on;
                # proxy_pass http://localhost:3000;
                # proxy_redirect off;
                #





                the secure nginx server instance



                server
                listen 443 ssl;
                ssl_certificate /etc/ssl/certs/.domainName.1.2018.chain.crt;
                ssl_certificate_key /etc/ssl/private/
                .domain.1.key;



                listen 80 default_server;



                server_name track.xxxxxxxxxx.com;



                server_name _;



                 location / 
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header Host $http_host;
                proxy_set_header X-NginX-Proxy true;
                proxy_set_header X-Ssl on;
                proxy_pass http://localhost:3000;
                proxy_redirect off;





                server
                listen 7003;
                server_name localhost;
                root /opt/ClientFolder/;
                location /
                try_files $uri @backend;



                location @backend 
                proxy_pass https://backend;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header Host $host;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                # Following is necessary for Websocket support
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";





                Please do needful.







                share|improve this answer








                New contributor




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









                share|improve this answer



                share|improve this answer






                New contributor




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









                answered Nov 22 at 7:47









                Kunal Differential Edge

                1




                1




                New contributor




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





                New contributor





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






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



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f117128%2fnginx-not-available-from-localhost-but-available-by-network%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

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay