I have an NGINX server currently running a ReactJS app, pointed at the /build folder, with HTPPS up and running via NGINX.
Alongside it, I used to have a NodeJS app (website) running on port 8888 with a reverse proxy to make it accessible through port 80 by default. This app used to run in HTTP protocol.
The need for this NodeJS website to be served in HTTPS has risen and I'm having quite a lot of trouble getting the two apps to function together. It's always either 502 errors or SLL_do_handshake errors.
This is my actual config. The React app block is untouched, it worked perfectly before I started tinkering with the Node one.
server {
listen 80 default_server;
server_name _;
return 301 https://$host$request_uri;
}
# PLATFORM - DEFAULT SERVER
server {
server_name platform.domain.com;
listen 80 default_server;
ssl_certificate /etc/ssl/certs/server.crt;
ssl_certificate_key /etc/ssl/certs/server.key;
location / {
proxy_pass https://xx.xx.xx.xx:8888/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
error_page 404 /404.html;
location = /404.html {}
error_page 500 502 503 504 /50x.html;
location = /50x.html {}
}
# REACT APP
server {
server_name dashboard.domain.com;
listen 443 ssl;
root /var/www/react-app/build;
index index.html;
include snippets/cert-params.conf;
include snippets/ssl-params.conf;
location / {
try_files $uri $uri/ /index.html;
}
}
My goal is to maintain its current function: 2 separate apps, on the same machine/webserver, that I can redirect to each other as the user requires.
What am I missing? Most of the answers lead me to make NGINX handle the HTTPS part and leave the NodeJS app running on HTTP, but I really need to have the NodeJS running on HTTPS.
Thanks in advance!