I have standard Apache configuration.
At domain.com
Apache is serving static html files (No backend technology)
At domain.com:2368
, there is a Ghost (blogging platform) instance, running NodeJS.
I want to have the following effect:
People should come in at domain.com/blog
and it should redirect (the content, not the URL) to the Ghost instance at the specific port.
So far, i have managed to make blog.domain.com
to point at Ghost, but I want /blog
to work too.
Here is my main VH:
<VirtualHost *:80>
ServerAdmin admin@domain.com
DocumentRoot /srv/www/htdocs/domain.com/
ServerName domain.com
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /srv/www/htdocs/domain.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
Here is the additional VH which redirects the port to blog.domain.com
<VirtualHost *:80>
ServerName blog.domain.com
ProxyPass / http://127.0.0.1:2368/
ProxyPassReverse / http://127.0.0.1:2368/
ProxyPreserveHost On
</VirtualHost>