By edmulraney
I’m trying to host two domains on a single droplet. domainA.com and domainB.com
domainA.com correctly shows content from /home/public/domainA/index.php correctly. domainB.com just shows domainA.com, whereas it should be showing the content of /home/public/domainB/index.php.
Both domains are using digitaloceans nameservers, have an entry in sites-available and sites-enabled.
domainA nginx config:
server { listen 80;
root /home/public/domainA/;
index index.php index.html index.htm;
server_name domainA.com www.domainA.com;
…
domainB nginx config:
server { listen 80
root /home/public/domainB/;
index index.php index.html index.htm;
server_name domainB.com www.domainB.com;
…
Any help resolving this matter would be much appreciated!
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Is that your entire configuration? You must have some PHP path for the .php files to work, ensure the root for that is set accordingly too.
This is just my quick resonse… Move the server name just below the port. Nginx reads configs in order, so that might make a difference… cause nginx would read… port 80… CHECK… go to this root (domainA). If you move it above you are doing Port 80… CHECK… domainA… FALSE… domainB… CHECK… <br> <br>
semicolon is missing after this line of domainB.com’s config: <br> <br>listen 80
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.