I tried to add nginx.config but getting unhealthy allocations errors at deploy.
Is there an easier, faster way to add simple reverse proxies directly on fly.toml on the same machine without having to add nginx to the Dockerfile or without having to run a standalone nginx app?
Usually, health indications might indicate the app failed to communicate with our platform for example the port was wrong or the app didn’t start/listen to that before the timeout or it wasn’t listening to loopback IP. Logs could help with this. Maybe Nginx didn’t start?
I can see that your proxy needs to live on a path to your website, Nginx is a good way to handle that, I’ve also seen some people talk about Caddy, you can find examples for both on this forum. Our toml file doesn’t support reverse proxies inside it. I suggest baking it on your Dockerfile so your instances know how to handle it.
The simple solution to the original problem is to use NextJS rewrites rather than a reverse proxy. Add the following to your config object in file next.config.js.