Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide Headers in Passenger/Nginx Server

I am trying to hide this headers for the production server but without success :

 X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 3.0.7
 X-Runtime: 0.021429
 Server: nginx/1.0.0 + Phusion Passenger 3.0.7 (mod_rails/mod_rack)

Using :

- Rails 3.0.9
- Passenger 3.0.7
- Nginx 1.0.0

Any ideas ?

like image 662
Hartator Avatar asked Jun 28 '11 16:06

Hartator


People also ask

What is passenger in nginx?

The Passenger Nginx module registers Passenger-specific configuration options inside Nginx. You, the administrator, configure Passenger by adding Passenger-specific configuration options to the Nginx configuration file. Restart or reload Nginx to apply any configuration changes.

What does Phusion Passenger do?

Phusion Passenger® is an open source web application server. It handles HTTP requests, manages processes and resources, and enables administration, monitoring and problem diagnosis. Passenger is very easy to use, makes deploying in production much easier and is scalable.


1 Answers

To remove nginx Server: header you could use server_tokens off directive.

For other headers try using Headers More nginx module:

more_set_headers 'Server: anon'; # replace the default 'nginx + Passenger'
more_set_headers 'X-Powered-By'; # clear header entirely
like image 191
AlexD Avatar answered Oct 18 '22 02:10

AlexD