Re: node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I will be in meeting for the rest of the afternoon. Here is an anonymized version of my working configuration. Hope it helps.

 

The main URL is https://directory.uexample.com/search

 

nodejs is expacting /search

 

<VirtualHost *:443>

        ServerName  directory.example.com

        ServerAlias hostnameaa.mid.example.com

        ServerAlias hostnameab.mid.example.com

 

        SSLEngine               on

 

        SSLCertificateFile      /etc/httpd/certs/cert.pem

        SSLCertificateKeyFile   /etc/httpd/certs/cert.pem

        SSLOptions              +StdEnvVars

 

        RewriteEngine On

        LogLevel alert rewrite:trace6

 

        CustomLog logs/nodejs_request_log \

                "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

 

        ErrorLog        /var/log/httpd/nodejs_error.log

        CustomLog       /var/log/httpd/nodejs_access.log combined

 

        DocumentRoot /var/www/iam-directory/dist

 

        # RewriteRule ^/health-check-test.txt$ /public/health-check-test.txt

        RequestHeader set "X-Forwarded-Proto" expr=%{REQUEST_SCHEME}

 

        # When a request comes in, test to see if there's a matching static file in the "public" dir

        RewriteCond %{DOCUMENT_ROOT}/public/%{REQUEST_URI} !-f

 

        # If request does not include a static file, proxy it to the backend

        RewriteRule ^(.*)$ http://localhost:8000$1 [P]

 

        # Otherwise, add "public" to it (e.g., serve the file)

        RewriteRule ^(.*)$ /public$1 [L]

 

</VirtualHost>

 

 

Darryl Baker, GSEC, GCLD  (he/him/his)

Sr. System Administrator

Distributed Application Platform Services

Northwestern University

4th Floor

2020 Ridge Avenue

Evanston, IL  60208-0801

darryl.baker@xxxxxxxxxxxxxxxx

(847) 467-6674

 

From: Kaushal Shriyan <kaushalshriyan@xxxxxxxxx>
Reply-To: Apache httpd Users <users@xxxxxxxxxxxxxxxx>
Date: Wednesday, June 21, 2023 at 12:40 PM
To: Apache httpd Users <users@xxxxxxxxxxxxxxxx>
Subject: Re: [users@httpd] node.js application listening on port 8000 enabled with SSL certificate returns ERR_SSL_PROTOCOL_ERROR on browser.

 

On Wed, Jun 21, 2023 at 10:35 PM Darryl Baker <darryl.baker@xxxxxxxxxxxxxxxx> wrote:

Have you tried browsing to https://nodejs.mydomain.com/demo/index.html The proxy configuration in Apache will direct the connection to nodejs over port 8000.

 

Hi Darryl,

 

When I am trying to access the URL https://nodejs.mydomain.com/demo/index.html, I am seeing the below information in Apache HTTP server access logs. 

 

172.16.16.45 - drupaladmin [21/Jun/2023:23:04:07 +0530] "GET /demo/index.html HTTP/1.1" 404 25644 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
172.16.16.45 - drupaladmin [21/Jun/2023:23:04:18 +0530] "GET /demo/index.html HTTP/1.1" 404 25644 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36"
172.16.16.45 - drupaladmin [21/Jun/2023:23:04:39 +0530] "GET /demo/index.html HTTP/1.1" 404 25644 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36" 

 

Please suggest further. Thanks in advance. 

 

Best Regards,

 

Kaushal


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux