
Halo, kalau kamu merasa tulisan saya ngebantu, kamu bisa ucapkan terima kasih lewat saweria .
If you feel this website help you, you can donate at saweria .
What I Used in This Tutorial
-
Ubuntu Server 22.04 LTS
-
Nginx v1.22.1 . I use ppa ondrej , it will make it easier to install other module in nginx, just using
apt install nginx-extras
you will get all usefull modules.
Remove or Modify Some Header in Nginx

server: nginx, Header Info We Want To Remove

It Will Become Like This, No server: nginx
- Install
nginx-extras
, useapt install nginx-extras

Error When nginx-extras Not Installed
-
Then go to
/etc/nginx/nginx.conf
, add this line athttp { . . . tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; #you just need add this #this mean you will hide nginx version server_tokens off; more_clear_headers Server; #just two line . . . }
-
Reload your nginx service
systemctl reload nginx.service
Additional
Change Server Header Info
- You can change your server header info, go to
/etc/nginx/nginx.conf
. then add
http {
.
.
.
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
#you just need add this
server_tokens off;
#change server info as Apache webserver
more_set_headers 'server: Apache'
#just two line
.
.
.
}

Change server: Header
Remove Multiple Header Info
-
Of course you can hide multiple header info
http { . . . tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; #you just need add this server_tokens off; more_clear_headers server location content-length; #just two line . . . }
Notes, be carefull when you do this, it can break your app config