How to remove 'X-Powered-By'?


#1

Hi! Can anyone help me with this?
Any suggestions @mrrobot47


What I finally did:

  1. Copied nginx.conf from the docker container to a local directory for editing
    docker cp services_global-nginx-proxy_1:/etc/nginx/nginx.conf /<your-dir>/nginx.conf
  2. Removed the line include /version.conf; by commenting and saved the file
  3. Copied the modified nginx.conf back to the docker container
    docker cp /<your-dir>/nginx.conf services_global-nginx-proxy_1:/etc/nginx/nginx.conf
  4. Restarted global service nginx-proxy
    ee service restart nginx-proxy
  5. Restarted site for good measure
    ee site restart <sitename>

#2

You would be wise to leave it in there for debugging.


#3

OK I understand but how do I do it if I wanted it to be hidden. Could you help?


#4

Remove the following line in nginx. conf file and restart nginx.

add_header X-Powered-By “EasyEngine”;


#5

That method doesn’t for v4


#6

Found that X-Powered-By comes from version.conf. Can this be excluded?
edit: I modified the /var/lib/docker/overlay2/…/merged/etc/nginx/nginx.conf file and was able to hide X-Powered-By. But it’ll probably get overwritten after a update. Is there a better approach?


#7

you can run

 grep -r  "X-Powered-By" /var/lib/docker/overlay2/* | grep version.conf

and edit file version.conf done


#8

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.