• 11

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

Apache SSL reverse proxy to a node server using websockets

Browsing to a root domain like https://sub.example.com and navigating through pages such as https://sub.example.com/page1 works.

But only if I start my initial connection at the root. If I refresh the browser while the URL is https://sub.example.com/page1, I get a 404:

Cannot GET /page1

I suspect it has something to do with some initial SSL handshake but I'm just not well versed enough in this subject matter to really figure out where I should be looking. I've tried many different site .conf files without luck. Works fine in my dev environment using basic HTTP access.

Here is a basic config file I've tried:

  <VirtualHost sub.example.com:80>
      ServerName sub.example.com

      <Location />
          ProxyPass http://localhost:3020/
          ProxyPassReverse http://localhost:3020/

      RewriteEngine on
      RewriteCond %{SERVER_NAME} =sub.example.com
      RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

  <VirtualHost sub.example.com:443>
      ServerName sub.example.com

      SSLEngine on
           SSLProxyEngine On
           ProxyRequests On

      <Location />
          ProxyPass http://localhost:3020/
          ProxyPassReverse http://localhost:3020/

      SSLCertificateFile /etc/letsencrypt/live/sub.example.com/cert.pem
      SSLCertificateKeyFile /etc/letsencrypt/live/sub.example.com/privkey.pem
      Include /etc/letsencrypt/options-ssl-apache.conf
      SSLCertificateChainFile /etc/letsencrypt/live/sub.example.com/chain.pem

      RewriteEngine on
      RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
      RewriteCond %{HTTP:CONNECTION} ^Upgrade$ [NC]
      RewriteRule .* ws://localhost:3020%{REQUEST_URI} [P]

Trending Tags