Look at this thread http://talk.plesk.com/threads/disable-http-header-x-powered-by-plesklin.260694/
And use Forum search next time before posting
SureDid you run
Code:/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
Afterwards?
Even many times i have restartedStrange, that did do the trick on my server which I just confirmed before posting here.
Try restarting your Web servers, just in case they didn't reload the new config.
cat /usr/local/psa/admin/conf/templates/default/*.php | grep PleskLin
nano /usr/local/psa/admin/conf/templates/default/*.php
cp /usr/local/psa/admin/conf/templates/default/server.php /usr/local/psa/admin/conf/templates/custom/server.php
cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
<IfModule mod_headers.c>
Header add X-Powered-By PleskLin
</IfModule>
<?php if (!$VAR->domain->physicalHosting->proxySettings['nginxTransparentMode'] && !$VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?>
location /internal-nginx-static-location/ {
alias <?php echo $OPT['documentRoot'] ?>/;
add_header X-Powered-By PleskLin;
internal;
}
/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
Hi Hayk,
the "correct" usage would be:
- Create a folder called "custom" at "/usr/local/psa/admin/conf/templates/", so that you have a custom "custom" directory for your unique modifications ( => /usr/local/psa/admin/conf/templates/custom ).
- Create a folder called "domain" at "/usr/local/psa/admin/conf/templates/custom/", so that you have a custom "domain" directory for your unique modifications ( => /usr/local/psa/admin/conf/templates/custom/domain ).
- Copy the desired template(s) to the "custom" folder
- Command over the command line:
Code:cp /usr/local/psa/admin/conf/templates/default/server.php /usr/local/psa/admin/conf/templates/custom/server.php
- Command over the command line:
Code:cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
- Delete / edit or modify the part of .../custom/server.php :
Code:<IfModule mod_headers.c> Header add X-Powered-By PleskLin </IfModule>
- Delete / edit or modify the part of .../custom/domain/nginxDomainVirtualHost.php :
Code:<?php if (!$VAR->domain->physicalHosting->proxySettings['nginxTransparentMode'] && !$VAR->domain->physicalHosting->proxySettings['nginxServeStatic']): ?> location /internal-nginx-static-location/ { alias <?php echo $OPT['documentRoot'] ?>/; add_header X-Powered-By PleskLin; internal; }
- Reconfigure your webserver with the command:
Code:/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
In some rare cases, you have to restart apache and nginx manually, even that the reconfigure-command includes the restarts of the two services.
- Smile to the camera and say: Cheeeeeeeeese
Many Thanks, and second question how to change delete "Server:nginx"
<?php if (!$VAR->server->webserver->proxyActive): ?>
<IfModule mod_headers.c>
Header add X-Powered-By
</IfModule>
<?php endif ?>
<?php endforeach ?>
add_header X-Powered-By;
# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all
Error occured while sending feedback. HTTP code returned: 502
Error occured while sending feedback. HTTP code returned: 502
Execution failed.
Command: httpdmng
Arguments: Array
(
[0] => --reconfigure-domains
[1] => bckpsrv.domain.com webmailer.domain.com
)
Details: [2017-09-13 09:31:48] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/nginx-config' '-t'] with exit code [1]
Error occured while sending feedback. HTTP code returned: 502
[2017-09-13 09:31:48] ERR [panel] Apache config (15052879010.49762300) generation failed: Template_Exception: nginx: [emerg] invalid number of arguments in "add_header" directive in /etc/nginx/plesk.conf.d/ip_default/bckpsrv.domain.com.conf:64
nginx: configuration file /etc/nginx/nginx.conf test failed
file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
Error occured while sending feedback. HTTP code returned: 502
nginx: [emerg] invalid number of arguments in "add_header" directive in /etc/nginx/plesk.conf.d/ip_default/bckpsrv.domain.com.conf:64
nginx: configuration file /etc/nginx/nginx.conf test failed
... it is most likely the case, that you may solve such an issue, by RE-creating the depending (sub)domain - specific configuration file, AFTER you deleted the mentioned (sub)domain - related webserver configuration file.invalid number of arguments in "add_header" directive
find /usr/local/psa/admin/conf/templates -type f -name "*.php" -exec grep --color -Hni "X-Powered-By" {} \;