Apache proxy, Node.js and Default Websites
Hello everyone !
I'm currently using a mac mini server under OS X Mavericks (10.9.1) and Server 3.0.2
I've been very happy with it, and found it was quite nice to use... until I decided to host a Ghost blog (https://ghost.org) on it. Ghost runs on Node.js (http://nodejs.org).
I have a domain (domain.com), and two subdomains (www.domain.com and sub.domain.com).
The server and it's default websites use sub.domain.com, with http://sub.domain.com redirecting to https://sub.domain.com
I want to use both domain.com and www.domain.com for the blog.
Using cloudflare for the DNS, I created a CNAME for domain.com, pointing to www.domain.com (domain.com CNAME www.domain.com).
Node.js and Ghost install both went well, with Node.js listening on port 2368.
I then started configuring a virtual host (www.domain.com) in the Server.app for the Ghost blog , along with an Apache Reverse Proxy, by editing www.domain.com's .conf and replacing everything in it by
<VirtualHost 10.0.1.2:80>
ServerName www.domain.com
ProxyPreserveHost on
ProxyPass / http://localhost:2368/
</VirtualHost>
Going to www.domain.com, I correctly end up on the Ghost blog.
But, amusingly and annoyingly, when trying to access the default website through sub.domain.com... it's also the blog that shows up ! 😕
After setting up another website (sub2.domain.com) in the Server.app and configuring the DNS appropriately at Cloudflare, I could notice that I end up on the default page for "empty" websites (the "welcome to Server... blabla" page).
So the server's default website is the only one getting this issue...
I've been spending two days on it, trying nearly every other Apache Reverse Proxy configuration I could find (yes, even the weird one where you go through DNS settings that you can find somewhere in these forums).
Anyway, some help would be greatly appreciated 😍
MAC MINI SERVER (LATE 2012), OS X Mavericks (10.9.1), Server 3.0.2