vhosts across different machines

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











up vote
0
down vote

favorite












I've set up vhosts in my LAMP stack, with one IP and a domain plus subdomains working on that same stack. My problem is I spun another nginx server for gitlabs(seperate VM) that I want a subdomain of repo.example.com to route to, however it defaults to the LAMP stack instead.



Am I correct that I should run a /etc/hosts file for each server listing the domains that should reach which each one uses? I'm trying to narrow down if my problem is with NGINX configs or my set up in general.



Basic info



  1. noip.com --> single home ip

  2. LAMP stack in a VM (working)

    • example.com

    • a.example.com

    • b.example.com


  3. NGINX stack on a VM running gitlabs

    • repo.example.com (defaults to example.com)










share|improve this question























  • I don't think you've explained your question very well. I can't tell if you need Apache help, nginx help, networking help, or something else.
    – Cupcake Protocol
    5 hours ago










  • I hope I simplified it. I don't think I need apache help, but I'm asking to see if my set up is the problem or if I have to look into my nginx configs.
    – dawja
    2 hours ago










  • What are you using /etc/hosts for? It's a poor substitute for real DNS. If you can't use real DNS, okay maybe. From your point 3 (as written now), I think your issue is you need an nginx virtual host configured. Are the hosts in 2 and 3 using the same IP ? If so how do you expect to route between nginx and apache? Are you using different ports? Are you binding one to a private IP and the other to a localhost IP and proxying?
    – Cupcake Protocol
    43 mins ago














up vote
0
down vote

favorite












I've set up vhosts in my LAMP stack, with one IP and a domain plus subdomains working on that same stack. My problem is I spun another nginx server for gitlabs(seperate VM) that I want a subdomain of repo.example.com to route to, however it defaults to the LAMP stack instead.



Am I correct that I should run a /etc/hosts file for each server listing the domains that should reach which each one uses? I'm trying to narrow down if my problem is with NGINX configs or my set up in general.



Basic info



  1. noip.com --> single home ip

  2. LAMP stack in a VM (working)

    • example.com

    • a.example.com

    • b.example.com


  3. NGINX stack on a VM running gitlabs

    • repo.example.com (defaults to example.com)










share|improve this question























  • I don't think you've explained your question very well. I can't tell if you need Apache help, nginx help, networking help, or something else.
    – Cupcake Protocol
    5 hours ago










  • I hope I simplified it. I don't think I need apache help, but I'm asking to see if my set up is the problem or if I have to look into my nginx configs.
    – dawja
    2 hours ago










  • What are you using /etc/hosts for? It's a poor substitute for real DNS. If you can't use real DNS, okay maybe. From your point 3 (as written now), I think your issue is you need an nginx virtual host configured. Are the hosts in 2 and 3 using the same IP ? If so how do you expect to route between nginx and apache? Are you using different ports? Are you binding one to a private IP and the other to a localhost IP and proxying?
    – Cupcake Protocol
    43 mins ago












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I've set up vhosts in my LAMP stack, with one IP and a domain plus subdomains working on that same stack. My problem is I spun another nginx server for gitlabs(seperate VM) that I want a subdomain of repo.example.com to route to, however it defaults to the LAMP stack instead.



Am I correct that I should run a /etc/hosts file for each server listing the domains that should reach which each one uses? I'm trying to narrow down if my problem is with NGINX configs or my set up in general.



Basic info



  1. noip.com --> single home ip

  2. LAMP stack in a VM (working)

    • example.com

    • a.example.com

    • b.example.com


  3. NGINX stack on a VM running gitlabs

    • repo.example.com (defaults to example.com)










share|improve this question















I've set up vhosts in my LAMP stack, with one IP and a domain plus subdomains working on that same stack. My problem is I spun another nginx server for gitlabs(seperate VM) that I want a subdomain of repo.example.com to route to, however it defaults to the LAMP stack instead.



Am I correct that I should run a /etc/hosts file for each server listing the domains that should reach which each one uses? I'm trying to narrow down if my problem is with NGINX configs or my set up in general.



Basic info



  1. noip.com --> single home ip

  2. LAMP stack in a VM (working)

    • example.com

    • a.example.com

    • b.example.com


  3. NGINX stack on a VM running gitlabs

    • repo.example.com (defaults to example.com)







nginx hosts apache-virtualhost






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 hours ago

























asked 7 hours ago









dawja

285




285











  • I don't think you've explained your question very well. I can't tell if you need Apache help, nginx help, networking help, or something else.
    – Cupcake Protocol
    5 hours ago










  • I hope I simplified it. I don't think I need apache help, but I'm asking to see if my set up is the problem or if I have to look into my nginx configs.
    – dawja
    2 hours ago










  • What are you using /etc/hosts for? It's a poor substitute for real DNS. If you can't use real DNS, okay maybe. From your point 3 (as written now), I think your issue is you need an nginx virtual host configured. Are the hosts in 2 and 3 using the same IP ? If so how do you expect to route between nginx and apache? Are you using different ports? Are you binding one to a private IP and the other to a localhost IP and proxying?
    – Cupcake Protocol
    43 mins ago
















  • I don't think you've explained your question very well. I can't tell if you need Apache help, nginx help, networking help, or something else.
    – Cupcake Protocol
    5 hours ago










  • I hope I simplified it. I don't think I need apache help, but I'm asking to see if my set up is the problem or if I have to look into my nginx configs.
    – dawja
    2 hours ago










  • What are you using /etc/hosts for? It's a poor substitute for real DNS. If you can't use real DNS, okay maybe. From your point 3 (as written now), I think your issue is you need an nginx virtual host configured. Are the hosts in 2 and 3 using the same IP ? If so how do you expect to route between nginx and apache? Are you using different ports? Are you binding one to a private IP and the other to a localhost IP and proxying?
    – Cupcake Protocol
    43 mins ago















I don't think you've explained your question very well. I can't tell if you need Apache help, nginx help, networking help, or something else.
– Cupcake Protocol
5 hours ago




I don't think you've explained your question very well. I can't tell if you need Apache help, nginx help, networking help, or something else.
– Cupcake Protocol
5 hours ago












I hope I simplified it. I don't think I need apache help, but I'm asking to see if my set up is the problem or if I have to look into my nginx configs.
– dawja
2 hours ago




I hope I simplified it. I don't think I need apache help, but I'm asking to see if my set up is the problem or if I have to look into my nginx configs.
– dawja
2 hours ago












What are you using /etc/hosts for? It's a poor substitute for real DNS. If you can't use real DNS, okay maybe. From your point 3 (as written now), I think your issue is you need an nginx virtual host configured. Are the hosts in 2 and 3 using the same IP ? If so how do you expect to route between nginx and apache? Are you using different ports? Are you binding one to a private IP and the other to a localhost IP and proxying?
– Cupcake Protocol
43 mins ago




What are you using /etc/hosts for? It's a poor substitute for real DNS. If you can't use real DNS, okay maybe. From your point 3 (as written now), I think your issue is you need an nginx virtual host configured. Are the hosts in 2 and 3 using the same IP ? If so how do you expect to route between nginx and apache? Are you using different ports? Are you binding one to a private IP and the other to a localhost IP and proxying?
– Cupcake Protocol
43 mins ago















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: 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%2f481168%2fvhosts-across-different-machines%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%2f481168%2fvhosts-across-different-machines%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

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

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?