I have a node.js server with express that serves an https web. The server is runing Windows 10. I have configured a no-ip ddns with ssl certificates. The web is on port 3000 and I want to start a reverse proxy with nginx to access it without having to specify the port, just the domain name. The problem is that nginx is working for local network machines but not external ones. This is the config for nginx:
worker_processes 1;
error_log logs/error.log;
error_log logs/error.log notice;
error_log logs/error.log info;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name servidordelacruz.dynns.com;
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
server_name xxxxxx.dynns.com;
ssl_certificate route_to\noip_fullchain_cert.pem;
ssl_certificate_key route_to\cert.key;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
location / {
proxy_pass https://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
}
I have ports 80 and 443 open on the router for the server and just for testing the windows firewall is disabled entirely. I also confirmed the ddns is working since I also have a minecraft server that is accesible. In the access.log file I can also see that the phone reaches the server:
X.X.X.X - - [05/Nov/2024:20:52:40 +0100] "GET / HTTP/1.1" 301 169 "-" "Mozilla/5.0 (Android 15; Mobile; rv:132.0) Gecko/132.0 Firefox/132.0"
Finally, in the errors. log file I see this error constantly:
2024/11/05 21:05:46 [info] 5276#10252: *943 SSL_do_handshake() failed (SSL: error:0A000412:SSL routines::sslv3 alert bad certificate:SSL alert number 42) while SSL handshaking, client: X.X.X.X, server: 0.0.0.0:443
The client IP is my own public IP. I read that it might not be important though.