Created
November 19, 2021 08:22
-
-
Save florinel-chis/53f63d51eead1011ea2c408465a81fdf to your computer and use it in GitHub Desktop.
expose mailhog publicly with basic auth
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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