Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
<VirtualHost *:443>

        SSLEngine on
        SSLProxyEngine On
        ProxyRequests Off

        SSLCertificateFile    /etc/ssl/certs/example/cert.pem
        SSLCertificateKeyFile /etc/ssl/certs/example/privkey.pem
        SSLCertificateChainFile /etc/ssl/certs/example/fullchain.pem

        RequestHeader set X-Forwarded-Proto "https"

		# Proxy the websocket connection
        ProxyPassMatch ^(\/(en|es)\/omk\/opEvents\/ws\/.*)$  ws://localhost:8042/$1
		# Proxy the rest of the application
        ProxyPass /en/omk http://localhost:8042/en/omk
        ProxyPass /es/omk http://localhost:8042/es/omk
        ProxyPass /omk http://localhost:8042/omk
        ProxyPassReverse / http://localhost:8042/
		ErrorDocument 503 '<html><head><meta http-equiv="refresh" content="60"></head><body><h1>Temporary Service Interruption</h1>The requested OMK page should be back soon. This page will automatically reload in 60 seconds.</body></html>'

<VirtualHost *:80>
    Redirect 301 /

If you receive a "server connection terminated before websocket handshake" response from the browser dev tools console with the above configuration for rhel/centos, then you need to handle the proxy as a rewrite rule , and then proxy that back to the webclient. 

Code Block
ProxyPassMatch ^(\/(en|es)\/omk\/opEvents\/ws\/.*)$  ws://localhost:8042/$1

 RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/en/omk/opEvents/ws/(.*)
    RewriteRule /(.*) ws://localhost:8042/en/omk/opEvents/ws/%1 [P,L] 

Settings which you will need to modify from the example