How-to point AWS hosted Nginx to reverse proxy to fly.io application?

domain.com with SSL hosted on AWS EC2 + Route 53 DNS

EC2 runs Nginx and reverse proxies to multiple upstream NodeJS applications hosted on the same EC2 server

location / currently points to http://site another NodeJS applications, which I am currently moving to Fly.io with reserved IP 1.1.1.1 and internal url site.internal

location / {
    proxy_pass http://site;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
  }

What should I do to have the Nginx load the fly.io application?

Thanks!

Not sure if i’m misunderstanding, but I think you could use https://<APP_NAME>.fly.dev once you know what <APP_NAME> is. Have you tested that out?

The https://<APP_NAME>.fly.dev, but I wonder why the https://IP doesn’t work if I have a reserved IP?

I think https://<IP_ADDRESS> definitely wouldn’t work because the SSL cert isn’t issued for the IP address. I haven’t seen anyone try http://<IP_ADDRESS> for the public proxy, not sure if it’s configured to understand that. Is there a reason why you want to avoid <APP_NAME>.fly.dev or another custom domain?

From How To to Questions / Help

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.