I have a node application running on port 3030 for an API which I want to access over HTTPS.
If I visit http://api.example.com:3030/*** I can load a 200 response with no problem so the node application is definitely running, however if I visit https://api.example.com/**** I get the following error in the browser:
Proxy Error The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /api/posts. and the following in the apache error log:
[Sun Jun 03 15:30:47.942229 2018] [proxy_http:error] [pid 30884] (103)Software caused connection abort: [client xx.xx.xx.xx:xxxxx] AH01102: error reading status line from remote server api.example.com:3030 [Sun Jun 03 15:30:47.942414 2018] [proxy:error] [pid 30884] [client xx.xx.xx.xx:xxxxx] AH00898: Error reading from remote server returned by /*** This is my Apache config:
<IfModule mod_ssl.c> <VirtualHost *:443> ServerName www.api.example.com ServerAlias api.example.com ServerAdmin webmaster@localhost DocumentRoot /var/www/html/xxxxxx/ ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined <Directory /var/www/html/xxxxxx/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> RewriteEngine on SetEnv proxy-initial-not-pooled 1 SSLEngine On SSLProxyEngine on SSLCertificateFile /etc/letsencrypt/live/example.com/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/example.com/privkey.pem Include /etc/letsencrypt/options-ssl-apache.conf SSLCertificateChainFile /etc/letsencrypt/live/example.com/chain.pem ProxyPreserveHost On ProxyPass / https://api.example.com:3030/ ProxyPassReverse / https://api.example.com:3030/ </VirtualHost> </IfModule> Versions of Apache and Node:
- node 8.11.2
- Apache 2.4.7
Any support is greatly appreciated, thanks.