Run Ghost without a port Run Ghost without a port apache apache

Run Ghost without a port


There is a blog post on http://0x1a.us/blog/2013/10/14/ghost-on-apache.html on how to run Ghost with Apache. The suggested virtual host configuration is:

<VirtualHost *:80>    ServerName your.blog.com    ProxyPass / http://127.0.0.1:2368/    ProxyPassReverse / http://127.0.0.1:2368/    ProxyPreserveHost On</VirtualHost>

It uses a virtual host configuration for apache and all traffic from port 80 is redirected to the local installation of Ghost which is running on port 2368. Using the virtual port configuration you could also redirect subdomains or subfolders to your Ghost blog.


After much investigation and messing about with my server setup, I have figured it out :)Now, my Ghost install runs on Ubuntu 12.04, with nginx 1.4.x. Here's the directive that I'm using:

[...] location / {        alias /var/www/site;                                                                     proxy_pass http://localhost:2368/;                                       proxy_set_header Host $host;                                             proxy_buffering off;                                       }[...]


I had the exact same problem and solved it using ProxyPass directive like the other answer suggested. There are actually a few other ways, see details here: http://blog.daniellam.name/ghost-playing-nice-with-apache-on-multi-site-server/

Also, as of Ghost v0.3.3, subdirectory in your Ghost blog URL will not work yet (e.g. http://www.yoursite.com/ghostblog/). It should be fixed in v0.4.