Skip to content

Instantly share code, notes, and snippets.

@letsjustfixit
Created May 18, 2015 19:37
Show Gist options
  • Save letsjustfixit/ad2d251879fbafbe5c02 to your computer and use it in GitHub Desktop.
Save letsjustfixit/ad2d251879fbafbe5c02 to your computer and use it in GitHub Desktop.
Ghost apache reverse proxy + 301 redirect
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName ghost.example.com
ServerAlias ghost.example.com
CustomLog /var/log/apache2/ghost.example.com_access.log common
ErrorLog /var/log/apache2/ghost.example.com_error.log
# this redirect is always ignored
RedirectMatch 301 ^/services/whatever/?$ /other-page/
#Exclude everything that needs a redirect
ProxyPass /services/whatever !
ProxyPassMatch ^/(.+)$ http://127.0.0.1:2368/$1
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment