Run your app behind ns-cdn-lab instead of the bundled Flask demo.
- Add your service to
docker-compose.yml(or adocker-compose.override.yml):
services:
my-app:
image: your-image:tag
# or build: ./path
networks:
- cdn-network
# Do NOT publish ports to the host if you want origin cloaking.- Point Nginx upstream at it (
nginx/nginx.conf):
upstream origin_backend {
server my-app:8080; # change port to match your app
keepalive 32;
}- Reload:
make reload
# or: make upOn Docker Desktop, the host is often reachable as host.docker.internal:
upstream origin_backend {
server host.docker.internal:3000;
keepalive 32;
}Ensure your app listens on 0.0.0.0, not only 127.0.0.1.
- Sends sensible
Cache-Controlon cacheable GETs - Does not require HTTPS from the edge (edge→origin is HTTP on the lab network)
- Health endpoint available for debugging
- You verified
X-Cache-StatusHIT/MISS through the edge
curl -Ik --resolve ns-cdn-lab.local:443:127.0.0.1 https://ns-cdn-lab.local/
make test # some origin-header assertions are Flask-specific; adjust as needed