I'm trying to set up a simple hello world flask app managed as a docker container behind nginx proxy manager (NPM) and accessed through a subdomain.
I have portainer and NPM working, I exposed port 80 and 443 on my router, and I've set up my cloudflare domain to point to my pi with ddclient to manage changing IPs. So far when I go to the domain I can see the npm greeting page without a problem.
Now, what I would like to have happen is when someone navigates to the subdomain, in this case helloflask.mydomain.cloud. They will be pointed to an nginx/docker compose app. However nothing has worked yet, and all I see are 502 bad gateways or "The page isn't redirecting properly" when I try to access it from the helloflask.mydomain.cloud url, and I'm not sure why or what to check to fix it.
I can connect to the server locally through port 8001 just fine.
Here are my current docker compose settings for the nginx and flask containers.
version: "3.7"
services:
flask:
build: ./flask
container_name: hello_world_flask
restart: always
environment:
- APP_NAME=MyFlaskApp
expose:
- 8080
nginx:
build: ./nginx
container_name: hello_world_flask_nginx
restart: always
ports:
- 8001:80
And my docker containers, hello_world_flask_default is the docker network with the nginx and flask containers. So I put that in my NPM Proxy Host, with details and SSL settings. (Maybe it's an https issue?)
And here are my cloudflare domain settings.
Thanks!



