Skip to content

Instantly share code, notes, and snippets.

@smotesko
Last active July 21, 2018 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save smotesko/a06d7e2d2a0f95e24b51 to your computer and use it in GitHub Desktop.
Save smotesko/a06d7e2d2a0f95e24b51 to your computer and use it in GitHub Desktop.
Apache vhost reverse proxy for using Vagrant env on a localhost:80 (Mac)
  • Configure Vagrant box to forward guest port 80 to host port 8001
  • Add vhost to your Apache:
<VirtualHost *:80>
  ServerName projectname.local
  ProxyPass / http://localhost:8001/
  ProxyPassReverse / http://localhost:8001/
  ProxyPreserveHost On
</VirtualHost>
  • Enable vhosts in httpd.conf:
Include /private/etc/apache2/extra/httpd-vhosts.conf
  • Restart Apache:
sudo apachectl -k restart

Useful info on setting up Vagrant env: http://jamesmcfadden.co.uk/using-vagrant-and-puppet-to-build-a-php-nginx-and-mysql-environment/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment