Join the community today
Become a Member

Install more_set_headers y/n setting not being considered

Discussion in 'Install & Upgrades or Pre-Install Questions' started by noly, Sep 29, 2017.

  1. noly

    noly Premium Member Premium Member

    71
    10
    8
    Jul 24, 2017
    Frankfurt/Germany
    Ratings:
    +20
    Local Time:
    11:44 AM
    1.13.x
    10.x
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: 1.13.5
    • PHP Version Installed: 7.0.24
    • MariaDB MySQL Version Installed: 10.1.26
    • When was last time updated Centmin Mod code base ? : just did
    • Persistent Config:
    • NGXDYNAMIC_NGXPAGESPEED='y'
      NGINX_PAGESPEED='y'
      LETSENCRYPT_DETECT=’y’
      ACMEDEBUG='y'
      PUREFTPD_DISABLED=y
      NGINX_LIBBROTLI='y'
      NGINX_MP4='y'
      ZOPCACHEDFT='y'
      PHPGEOIP_ALWAYS='n'
      PHPDEBUGMODE='n'
      PHPFINFO='n'
      NGINX_VHOSTSSL='y'
      PHP_VERSION='7.0.24'
      AUTO_GITUPDATE='n'
      PHP_PGO='y'
      NGINX_HTTP2='y'
      NGINX_IPV='n'
      ENABLEMOTD='n'
      WPCLI_SUPERCACHEPLUGIN='y'
      NGINX_CACHEPURGE='y'
      ORESTY_HEADERSMORE='n'
      CLANG='y'
      NGINX_MAXERRBYTELIMIT='4096'




    • Hello Houston, issue here in space...

      just upgraded on the production server from nginx 1.13.3 to 1.13.5 and even though i am setting in my persistent config file: ORESTY_HEADERSMORE='n' i get the following error

      Code:
      nginx -t
      nginx: [emerg] unknown directive "more_set_headers" in /usr/local/nginx/conf/nginx.conf:35
      nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
      Server is down.
      :-( :-( :-(


      EDIT:

      Setting ORESTY_HEADERSMORE='y' and recompiling nginx and we are running again.

      I guess..

      Code:
      more_set_headers "Server: nginx centminmod";
      more_set_headers "X-Powered-By: centminmod";
      ..is added to nginx.conf no matter if ORESTY_HEADERSMORE is et to "n"
     
  2. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    7:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    if you disable headers more nginx module, comment out
    Code (Text):
    more_set_headers "Server: nginx centminmod";
    more_set_headers "X-Powered-By: centminmod";
    

    FYI, headers more is also used for letsencrypt integration in addons/acmetool.sh and also in wordpress centmin.sh menu option 22's redis nginx level caching so best to leave it enabled.
     
    • Informative Informative x 1
  3. noly

    noly Premium Member Premium Member

    71
    10
    8
    Jul 24, 2017
    Frankfurt/Germany
    Ratings:
    +20
    Local Time:
    11:44 AM
    1.13.x
    10.x
    Thanks for the hint. (y)
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,196
    6,789
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,144
    Local Time:
    7:44 PM
    Nginx 1.13.x
    MariaDB 5.5
    If you just want to remove the server headers, you do not need to disable headers more. Just override the headers as per docs at https://github.com/openresty/headers-more-nginx-module

    i.e. don't remove the first 2 as centmin mod checks to see if they're missing and re-adds them anyway
    Code (Text):
    more_set_headers "Server: nginx centminmod";
    more_set_headers "X-Powered-By: centminmod";
    more_set_headers "Server: nginx";
    more_clear_headers "X-Powered-By";
    

    might add those last 2 to default nginx.conf template commented out so folks can uncomment to enable.
    Code (Text):
    curl -I localhost
    HTTP/1.1 200 OK
    Date: Fri, 29 Sep 2017 03:07:08 GMT
    Content-Type: text/html; charset=utf-8
    Content-Length: 3801
    Last-Modified: Tue, 04 Apr 2017 07:34:43 GMT
    Connection: keep-alive
    Vary: Accept-Encoding
    ETag: "58e34c93-ed9"
    Server: nginx
    Accept-Ranges: bytes
    

    This will then keep other centmin mod features which rely on headers more nginx module working

    Server header can be whatever you want they it follows the format above "Server: whatever".
     
    • Informative Informative x 1