Nginx reverse proxy for multiple domains and subdomains

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











up vote
1
down vote

favorite












I have server running differnt sites and i need to config nginx reverse proxy for that domains(example1.com, example2.com,test.example1.com),where I need to config the domains in nginx for reverse proxy.










share|improve this question







New contributor




AsWiN KaRtHiK 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

    favorite












    I have server running differnt sites and i need to config nginx reverse proxy for that domains(example1.com, example2.com,test.example1.com),where I need to config the domains in nginx for reverse proxy.










    share|improve this question







    New contributor




    AsWiN KaRtHiK 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

      favorite









      up vote
      1
      down vote

      favorite











      I have server running differnt sites and i need to config nginx reverse proxy for that domains(example1.com, example2.com,test.example1.com),where I need to config the domains in nginx for reverse proxy.










      share|improve this question







      New contributor




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











      I have server running differnt sites and i need to config nginx reverse proxy for that domains(example1.com, example2.com,test.example1.com),where I need to config the domains in nginx for reverse proxy.







      nginx reverse-proxy subdomain multiple-instances






      share|improve this question







      New contributor




      AsWiN KaRtHiK 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 question







      New contributor




      AsWiN KaRtHiK 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 question




      share|improve this question






      New contributor




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









      asked 2 hours ago









      AsWiN KaRtHiK

      61




      61




      New contributor




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





      New contributor





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






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




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote













          multiple server blocks and proxy_pass http://origin.server in location blocks.



          For example:




          server
          test.example1.com;
          location /
          proxy_pass http://origin.text.example1.com;


          server
          server_name example1.com;
          location /
          proxy_pass http://origin.example1.com;


          server
          server_name example2.com;
          location /
          proxy_pass http://origin.example2.com;




          nginx Beginner's Guide and
          Server names in nginx document will help you.



          More complex configurations(including /etc/nginx/sites-enabled/.conf, /etc/nginx/sites-available/.conf) are available, but that relies on your distribution packages.






          share|improve this answer




















            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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );






            AsWiN KaRtHiK 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%2f937103%2fnginx-reverse-proxy-for-multiple-domains-and-subdomains%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote













            multiple server blocks and proxy_pass http://origin.server in location blocks.



            For example:




            server
            test.example1.com;
            location /
            proxy_pass http://origin.text.example1.com;


            server
            server_name example1.com;
            location /
            proxy_pass http://origin.example1.com;


            server
            server_name example2.com;
            location /
            proxy_pass http://origin.example2.com;




            nginx Beginner's Guide and
            Server names in nginx document will help you.



            More complex configurations(including /etc/nginx/sites-enabled/.conf, /etc/nginx/sites-available/.conf) are available, but that relies on your distribution packages.






            share|improve this answer
























              up vote
              2
              down vote













              multiple server blocks and proxy_pass http://origin.server in location blocks.



              For example:




              server
              test.example1.com;
              location /
              proxy_pass http://origin.text.example1.com;


              server
              server_name example1.com;
              location /
              proxy_pass http://origin.example1.com;


              server
              server_name example2.com;
              location /
              proxy_pass http://origin.example2.com;




              nginx Beginner's Guide and
              Server names in nginx document will help you.



              More complex configurations(including /etc/nginx/sites-enabled/.conf, /etc/nginx/sites-available/.conf) are available, but that relies on your distribution packages.






              share|improve this answer






















                up vote
                2
                down vote










                up vote
                2
                down vote









                multiple server blocks and proxy_pass http://origin.server in location blocks.



                For example:




                server
                test.example1.com;
                location /
                proxy_pass http://origin.text.example1.com;


                server
                server_name example1.com;
                location /
                proxy_pass http://origin.example1.com;


                server
                server_name example2.com;
                location /
                proxy_pass http://origin.example2.com;




                nginx Beginner's Guide and
                Server names in nginx document will help you.



                More complex configurations(including /etc/nginx/sites-enabled/.conf, /etc/nginx/sites-available/.conf) are available, but that relies on your distribution packages.






                share|improve this answer












                multiple server blocks and proxy_pass http://origin.server in location blocks.



                For example:




                server
                test.example1.com;
                location /
                proxy_pass http://origin.text.example1.com;


                server
                server_name example1.com;
                location /
                proxy_pass http://origin.example1.com;


                server
                server_name example2.com;
                location /
                proxy_pass http://origin.example2.com;




                nginx Beginner's Guide and
                Server names in nginx document will help you.



                More complex configurations(including /etc/nginx/sites-enabled/.conf, /etc/nginx/sites-available/.conf) are available, but that relies on your distribution packages.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 37 mins ago









                minish

                46617




                46617




















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









                     

                    draft saved


                    draft discarded


















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












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











                    AsWiN KaRtHiK 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%2f937103%2fnginx-reverse-proxy-for-multiple-domains-and-subdomains%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    One-line joke