I have two domains:
(1) myvery.owndomain.com
(2) domain.synology.me
(1) is under my control (I own the domain) and I manage the certs (Let's Encrypt).
If I visit "https://myvery.owndomain.com" I'm greeted by the "Welcome to Nginx!" landing page. (I use nginx as a reverse proxy only.)
(2) is a DDNS that Synology manages and it also has certs by LE (managed by Synology).
I have a Mac Mini running the "main" Nginx server and a bunch of other services. (1) points to theses services on the Mini. The IP of the mini is 192.168.13.10.
(2) points to a NAS that has it's own Nginx to handle, among other things, the LE certs. This machine runs on IP 192.168.11.10.
Without any settings in the "main" nginx, I can't use (2) because in my router (EdgeRouter X) both :80 and :443 point to the Mini (192.168.13.10).
So I need to add two new server blocks in my config so that:
If I visit "http://domain.synology.me" (port 80) that redirects me to "http://domain.synology.me:5000"
and
If I visit "https://domain.synology.me" (port 443) that redirects me to "https://domain.synology.me:5001"
I've managed to get part of the way. But I'm getting SSL errors like for instance: "SSL_read() failed (SSL: error:14094412:SSL routines:ssl3_read_bytes:sslv3 alert bad certificate:SSL alert number 42) while waiting for request, client: 192.168.13.1, server: 0.0.0.0:443"
What am I doing wrong?
Here's my current config: https://gist.github.com/BeyondEvil/e246d1725438989815272ac96fd1a767
Thanks!