Sep 19, 2018

How to remove X-Powered-By on Glassfish server

In domain/config/default-web.xml file, you’ll need to set the servlet’s xpoweredBy init-param to false.

Or from command line:
glassfish3/bin/asadmin set
glassfish3/bin/asadmin set

Please be advised that we need to set both http-listener-1 and http-listener-2 if you want to get rid of it both on http and https.

You don't need to restart domain to take effect.
To verify:
glassfish3/bin/asadmin get*

curl -kv https://localhost > /dev/null

To get all xpowered-by values:

glassfish3/bin/asadmin get "*" | grep xpowered

See also: