NGINX users: Please consider switching to the newest nginx config template. Itās heavily reworked and solves all above issues.
For the application server that is. And apart from (idependent!) proxy issues e.g. if you use a container or a even more complex setup.