My site is on nginx server. Im add to the /etc/nginx/nginx.conf
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
The headers is not appear on the site:
We need more about your nginx.conf
file, but you can add this directives into your server
block:
server {
listen 80;
server_name example.com;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
# ...
}
Maybe located at /etc/nginx/sites-enabled/example.com
or /etc/nginx/conf.d/example.com.conf
.
As indicated in the http
block in /etc/nginx/nginx.conf
:
http {
# ...
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}