How do I add a module to NGINX in Laravel Forge?

Linode Staff

I need to install one or the other of nginx-module-security-headers or nginx-module-headers-more to remove the "server" HTTP header.

1 Reply

Removing the Server Header Banner

I believe you can do this without modules. You will want to first backup your /etc/nginx/nginx.config file:

sudo cp /etc/nginx/nginx.config etc/nginx/nginx.config.bak

Edit /etc/nginx/nginx.config, and add the following line at the top of the config:

server_tokens off;

Restart your nginx server.

Understanding NGINX Modules in Forge

Unlike Apache, NGINX Modules need to be compiled into NGINX, so you would need to follow the instructions for the particular modules. I was unable to locate the modules you mention, but I did find this link that explains the complications of custom compliling NGINX in your environment.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct