Skip to content

Instantly share code, notes, and snippets.

@florinel-chis
Created November 19, 2021 08:22
Show Gist options
  • Save florinel-chis/53f63d51eead1011ea2c408465a81fdf to your computer and use it in GitHub Desktop.
Save florinel-chis/53f63d51eead1011ea2c408465a81fdf to your computer and use it in GitHub Desktop.
expose mailhog publicly with basic auth
<VirtualHost *:80>
# Name for your virtualhost
ServerName mailhog.myawesomedomain.com
# Proxy config
ProxyPreserveHost On
ProxyRequests Off
# Websocket proxy needs to be defined first
ProxyPass "/api/v2/websocket" ws://localhost:8025/api/v2/websocket
ProxyPassReverse "/api/v2/websocket" ws://localhost:8025/api/v2/websocket
# General proxy
ProxyPass / http://localhost:8025/
ProxyPassReverse / http://localhost:8025/
<Location />
AuthType Basic
AuthName "Restricted Content"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Location>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment