I’m attempting to serve Ghost as a sub-directory on my site (example.com/blog) using Apache2 to serve both Ghost and my main web app. I’ve followed most of the tutorials available out there.
I’m using the following setup:
Ghost-CLI version: 1.12.0
Ghost version: 3.0.0
When I set Ghost to serve on the “/” root domain, it works perfectly. I accomplished this through mod_proxy rules on the VirtualHost config file in my apache2/sites-available folder:
ProxyPreserveHost On ProxyPass / http://127.0.0.1:2368/ ProxyPassReverse / http://127.0.0.1:2368/
In an attempt to serve the blog on a sub-directory, I changed configuration information for both Ghost and Apache2. For Apache2 config, it looks like this:
ProxyPreserveHost On ProxyPass /blog http://127.0.0.1:2368/ ProxyPassReverse /blog http://127.0.0.1:2368/
For Ghost config, I changed the URL to be: “http://example.com/blog”
When I hit “/blog” on my site, it just says “Cannot Get /”. Looking at the header information, I see that Express is serving the 404 error page. Since my main app doesn’t use node, I’m pretty sure it’s getting to the Ghost application and then something is failing.
*I’ve tried all combinations of “/” at the end of the configuration lines.
I’m not sure what to try next. Any help would be greatly appreciated!