dunglas / mercure

🪽 An open, easy, fast, reliable and battery-efficient solution for real-time communications
https://mercure.rocks
GNU Affero General Public License v3.0
3.83k stars 278 forks source link

apache problem with SSL #258

Closed tpharaoh closed 4 years ago

tpharaoh commented 4 years ago

Using other posted issues, I was able to get it almost working.

JWT_KEY='!ChangeMe!' ACME_HOSTS='my_dmain_in_dns' ADDR='localhost:3000' ./mercure

starts without error

My apache settings as follows

<VirtualHost *:443>
    ServerName my_dmain_in_dns
    ServerAlias my_dmain_in_dns
    ProxyRequests Off

 <LocationMatch /hub >
       ProxyPass https://localhost:3000
       ProxyPassReverse https://localhost:3000
 </LocationMatch>
 </VirtualHost>

mercure shows: 2020/04/23 14:23:36 http: TLS handshake error from 127.0.0.1:42254: EOF

NOTE: I tried also removing the acme_hosts, so it would listen on http and route apache fole to http://localhost:3000 and I get SSL Proxy requested for socket.nbiot.taitotekniikka.fi:443 but not enabled [Hint: SSLProxyEngine]

tpharaoh commented 4 years ago

So, I made a small change: JWT_KEY='!ChangeMe!' ADDR='localhost:3000' /home/mercure/mercure

and in conf file

  ProxyRequests Off
<LocationMatch /hub >
      ProxyPass http://localhost:3000
      ProxyPassReverse http://localhost:3000
</LocationMatch>
</VirtualHost>

Now it resonds, but I get http 405, method not allowed 127.0.0.1 - - [24/Apr/2020:17:27:35 +0300] "OPTIONS /.well-known/mercure?topic=https%3A%2F%2F4a2a642c.ngrok.io%2Fapi%2Falarms%2F%7Bid%7D HTTP/1.1" 405 0 "https://domain.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:75.0) Gecko/20100101 Firefox/75.0"

tpharaoh commented 4 years ago

the last issue was solved by cors_allowed_origins=*