Skip to content

Instantly share code, notes, and snippets.

@namnv609
Last active February 12, 2019 21:13
Show Gist options
  • Save namnv609/a255f5c69018e7d15421f749a4abd5d4 to your computer and use it in GitHub Desktop.
Save namnv609/a255f5c69018e7d15421f749a4abd5d4 to your computer and use it in GitHub Desktop.
ActionCable WebSocket with Apache2 proxy
<VirtualHost *:80 *:443>
# Domain
ServerName servername.domain
SSLEngine On
SSLProxyEngine On
# Path to SSL CRT file
SSLCertificateFile /etc/apache2/ssl/apache.crt
# Path to SSL KEY file
SSLCertificateKeyFile /etc/apache2/ssl/apache.key
ProxyRequests Off
ProxyPreserveHost On
<Location />
ProxyPass http://0.0.0.0:3000/
ProxyPassReverse http://0.0.0.0:3000/
</Location>
<Location /cable>
ProxyPass ws://0.0.0.0:3000/cable
ProxyPassReverse ws://0.0.0.0:3000/cale
</Location>
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment