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.ba...@northwestern.edu<mailto:darryl.ba...@northwestern.edu>
(847) 467-6674<tel:+18474676674>

From: Kaushal Shriyan <kaushalshri...@gmail.com>
Reply-To: Apache httpd Users <users@httpd.apache.org>
Date: Wednesday, June 21, 2023 at 12:40 PM
To: Apache httpd Users <users@httpd.apache.org>
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.ba...@northwestern.edu<mailto:darryl.ba...@northwestern.edu>> wrote:
Have you tried browsing to 
https://nodejs.mydomain.com/demo/index.html<https://urldefense.com/v3/__https:/nodejs.mydomain.com/demo/index.html__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KSMzAkvQ$>
 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<https://urldefense.com/v3/__https:/nodejs.mydomain.com/demo/index.html__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KSMzAkvQ$>,
 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<https://urldefense.com/v3/__http:/114.0.0.0__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KJuYS9Rw$>
 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<https://urldefense.com/v3/__http:/114.0.0.0__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KJuYS9Rw$>
 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<https://urldefense.com/v3/__http:/114.0.0.0__;!!Dq0X2DkFhyF93HkjWTBQKhk!TZD1QETIHXxGbXkvaOLsX03foc0jn2E1FS5Z_Kja7PeeQR008rxywleqnkIJCYooG8TKmQP23AlrwJfscB6auUCd15KJuYS9Rw$>
 Safari/537.36"

Please suggest further. Thanks in advance.

Best Regards,

Kaushal

Reply via email to