strapi icon indicating copy to clipboard operation
strapi copied to clipboard

enhancement: set app.proxy automatically if proxy is set

Open innerdvations opened this issue 8 months ago • 2 comments

What does it do?

Set koa app.proxy automatically if server.proxy.global, server.proxy.http, or server.proxy.https is set

TODO:

  • [ ] add a test
  • [ ] update documentation

Why is it needed?

If a proxy is used, this value must be true or else koa won't work. So it saves the user the extra config of adding proxy.koa:true to their server config

How to test it?

  • Set server.proxy.global (or http or https) and koa should automatically set app.proxy to true and work
  • server.koa should still be able to override that value so a user can turn it on without explicitly setting a proxy in strapi (for example, if they have their own custom method)
  • technically setting server.koa:false should also override and keep it as false, but I don't really see a use-case for it; we may just want to make it true and output a warning that the option is in conflict

Related issue(s)/PR(s)

https://github.com/strapi/strapi/pull/20416

innerdvations avatar Jun 17 '24 11:06 innerdvations