2

I want to disable the default nginx behaviour where it adds a Server header including the nginx version: nginx/1.18.0. I'm fine if it just says nginx.

From what I can find, I can do that by adding set server_tokens off; in my nginx config file. But where do I add it?

I have a 00_application.conf in .ebextensions/nginx/conf.d/elasticbeanstalk, which has a location / { } block with some config and nothing else. But the deployment fails if I add the above line, either in the block or outside it.

Googling has only resulted in "you can replace the entire elasticbeanstalk nginx config file" which seems like major overkill for something so simple.

How do I do this nicely?

Jorn
  • 501
  • 1
  • 4
  • 14
  • 3
    Remove the `set`, it's `server_tokens off;` - see [the manual page](http://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens). – Richard Smith May 31 '21 at 11:10

0 Answers0