Nginx bad gateway help

I am new to this, so I am certain I am doing something wrong or have misunderstood something.

I have a domain with cloudflare that i have sub.mydomain going to my home ip. I have ports 80 and 443 forwared to my truenas server. I have nginx and nextcloud installed. nextcloud is on port 30087. nginx has http port bind to 80 and https port bind set to 443. In Nginx proxy hosts i have sub.mydomain set to the destination of (server ip) ex- 192.0.0.0:443.

With that I get a bad gateway error.

If i don’t have anything setup in proxy hosts, i get the default nginx message, so its getting that far.

What do I have missing or out of wack?

from the top of my head.

  • Have you changed the port Truenas is listening to from 443 to 444? Else nginx and truenas webui are both listening to 443.
  • for your sub.mydomain you forward to your nextcloud Ip:port I guess? you can try http or https, I guess if you always wants https between nginx → nextcloud some more settings have to be adjusted. The Internet → nginx is already https.