I have a simple NodeJS server that has two POST routes. When I make POST requests from Postman, I see in the logs that the requests come through as GET requests to my deployed Fly application. However, the same requests work fine when running my app locally.
I’m new to Fly and I’m hoping I’m just missing something simple, any help would be appreciated.
If you can reproduce the issue reliably, can you try with this header: flyio-debug: doit and respond here with the fly-request-id header. We can then look up a trace and possibly figure out what’s happening.
I have the same error with an axum app, the post request from Postman is turned into a get request, but everything work fine locally.
The fly-request-id is 01GTZWDZ13GVYH7W6CVCNAXXPH-cdg
That was a Postman error. I forgotten the “https://” at the begining of the url and the request returned a 301 that redirected to the location with https, but posman follow every redirect with a get
I had a similar issue with SSR and force_https = true in my fly.toml file. When server rendering my app I would pass the current URL from the request. The protocol of the request URL seems to always be http. My app will make fetch requests while server rendering. Fly’s reverse proxy would redirect these to https turning my POST requests into GET requests. The solution was to use the X-Forwarded-Proto header to set the correct protocol before handing the URL to my app.