Nginx proxy not redirecting when using url name?

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











up vote
0
down vote

favorite












When I type in the IP address of the reverse proxy directly into my browser bar, it does perform the redirect.



When using a URL that is resolved via the /etc/hosts entry 203.0.113.2 git.example.com the "Welcome to Ngnix page" is shown. Any ideas? This is the configuration:



server 
listen 80;
server_name git.example.com;

proxy_set_header X-Real-IP $remote_addr; # pass on real client IP

location /
proxy_pass http://203.0.113.1:3000;




One interesting thing is that I can navigate to for example:



http://203.0.113.2/issues


If I then change 203.0.113.2 with git.example.com I get Nginxs "404 not found" page.










share|improve this question

























    up vote
    0
    down vote

    favorite












    When I type in the IP address of the reverse proxy directly into my browser bar, it does perform the redirect.



    When using a URL that is resolved via the /etc/hosts entry 203.0.113.2 git.example.com the "Welcome to Ngnix page" is shown. Any ideas? This is the configuration:



    server 
    listen 80;
    server_name git.example.com;

    proxy_set_header X-Real-IP $remote_addr; # pass on real client IP

    location /
    proxy_pass http://203.0.113.1:3000;




    One interesting thing is that I can navigate to for example:



    http://203.0.113.2/issues


    If I then change 203.0.113.2 with git.example.com I get Nginxs "404 not found" page.










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      When I type in the IP address of the reverse proxy directly into my browser bar, it does perform the redirect.



      When using a URL that is resolved via the /etc/hosts entry 203.0.113.2 git.example.com the "Welcome to Ngnix page" is shown. Any ideas? This is the configuration:



      server 
      listen 80;
      server_name git.example.com;

      proxy_set_header X-Real-IP $remote_addr; # pass on real client IP

      location /
      proxy_pass http://203.0.113.1:3000;




      One interesting thing is that I can navigate to for example:



      http://203.0.113.2/issues


      If I then change 203.0.113.2 with git.example.com I get Nginxs "404 not found" page.










      share|improve this question













      When I type in the IP address of the reverse proxy directly into my browser bar, it does perform the redirect.



      When using a URL that is resolved via the /etc/hosts entry 203.0.113.2 git.example.com the "Welcome to Ngnix page" is shown. Any ideas? This is the configuration:



      server 
      listen 80;
      server_name git.example.com;

      proxy_set_header X-Real-IP $remote_addr; # pass on real client IP

      location /
      proxy_pass http://203.0.113.1:3000;




      One interesting thing is that I can navigate to for example:



      http://203.0.113.2/issues


      If I then change 203.0.113.2 with git.example.com I get Nginxs "404 not found" page.







      docker nginx






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked 2 days ago









      Ole

      2531311




      2531311

























          active

          oldest

          votes











          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f473701%2fnginx-proxy-not-redirecting-when-using-url-name%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f473701%2fnginx-proxy-not-redirecting-when-using-url-name%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)