cloudpanel-io / vhost-templates

Application Vhost Templates for CloudPanel
https://www.cloudpanel.io
49 stars 43 forks source link

Nginx / PHP is showing double-headers (easy fix though) #31

Open Jas0n99 opened 4 months ago

Jas0n99 commented 4 months ago

I noticed all the add_header statements under the http block in nginx.conf were being displayed twice for PHP files. I guess because nginx runs through everything twice, once for the original request, a second time when sending to the PHP proxy.

Easy fix is to simply add:

add_header "" "";

Within the server 8080 block for the PHP fastcgi.

Nginx add_header is annoying in that sense. The "headers more" ngx module gives so much more flexibility, works as one would expect headers to work, and also prevents duplicate headers if you declare it multiple times. Might be something to think about adding to the build in the future.