Nginx – Remove “X-Page-Speed” version from headers in ngx_pagespeed

http-headersmod-pagespeednginx

I have compiled ngx_pagespeed, but forgot to remove the version number. Is there any way to overwrite/delete/hide them?

Apache has feature to 'unset' them, but I couldn't find anything similar for nginx. Perhaps I do not know how to use headers module?

Or should go to look around in source code and then recompile?

Perhaps anyone could point the exact location then?

Thanks.

Best Answer

Pagespeed module has a built-in capability to change this in the configuration. Please use the following in your vhost or nginx.conf or where you defined pagespeed configurations...

pagespeed XHeaderValue "Powered By Dzh - Change this to whatever!";

Ref: https://developers.google.com/speed/pagespeed/module/configuration (under the header "Specifying the value for the PageSpeed header").