Reverse Proxy rules in router
Permanently deleted user
Is it possible to make Reverse Proxy rules in the routes.
I would like to Reverse Proxy to a legacy application for some parts which cannot be migrates easily to platform sh
As far as I saw I can only add “redirect” rules.
In the Netlify documentation I found that there you can configure something that they call “rewrite” rules: https://docs.netlify.com/routing/redirects/rewrites-proxies/
This is exactly the thing that I imagine having in platform sh
For other purposes it would be great to have Reverse Proxy rules which can proxy to a WebSocket endpoint: https://www.nginx.com/blog/websocket-nginx/
0
Comments
At this time the router only supports redirects. You can do rewrites o the application container in
.platform.app.yaml. See:https://docs.platform.sh/configuration/app/web.html#how-can-i-rewrite-an-incoming-request-without-a-redirect
That cannot forward to an external server directly, however.
Another option would be to use a Varnish service, which you can configure to do whatever kind of request fiddling you want:
https://docs.platform.sh/configuration/services/varnish.html
Assuming your legacy application is on a 3rd party host, I think Varnish is probably your best option at the moment.
If your project is a multi-app setup with new and old applications both present in separate applications, you can do path-based routing to map some requests to the old app container and some to the new app container. See:
https://docs.platform.sh/configuration/routes/redirects.html
Cheers.
Please sign in to leave a comment.