AndrewBelt / hack.chat

a minimal, distraction-free chat application
https://hack.chat/
MIT License
2.39k stars 337 forks source link

For apache users #121

Closed aclard closed 7 years ago

aclard commented 7 years ago

I have been trying to adapt AndrewBelt's nginx configuration to my apache2.4 server recently, and i managed to succeed. Just wanted to help some of you, i'm using SSL and port 443. And hack.chat's websocket on port 8080 Loaded modules are proxy.load proxy_wstunnel.load and proxy_http.load

here is my vhost :

<VirtualHost *:443>
        ServerName domain.com
        ServerAlias domain.com
        DocumentRoot /var/www/domain.com/
        CustomLog /var/log/apache2/secure_access.log combined
        SSLEngine on
        SSLCertificateFile /path/to/ssl/cert/fullchain.pem
        SSLCertificateKeyFile /path/to/ssl/cert/privkey.pem
        SSLCACertificateFile /path/to/ssl/cert/chain.pem
        SSLVerifyClient None
        ProxyPreserveHost On
        ProxyRequests Off
        ProxyAddHeaders On
        RequestHeader set X-Real-IP %{REMOTE_ADDR}s
        RequestHeader set Host %{HTTP_HOST}s
        RequestHeader set X-Forwarded-For %{X-Forwarded-For}i
        ProxyPass /chat-ws ws://localhost:8080/
        ProxyPassReverse /chat-ws ws://localhost:8080/
  </VirtualHost>

Hope it helps.

AndrewBelt commented 7 years ago

Thanks, this will surely help someone!

Closing, but you can still search for it and use the permanent link.