ISPCFG failing to write nginx vhost files

Discussion in 'Installation/Configuration' started by Ovidiu, May 29, 2016.

  1. Ovidiu

    Ovidiu Active Member

    So what I am trying to accomplish is remove a customization I had previously and successfully made.

    I removed the old code from /usr/local/ispconfig/server/conf-custom/nginx_vhost.conf.master as you can see its no longer here:
    [email protected]:~# grep -R -i 'skip' /usr/local/ispconfig/server/conf-custom/
    [email protected]:~#
    I then edited and removed the code from /etc/nginx/nginx.conf
    And last but not least edited each and every hosted site via the ISPCFG gui and removed the last bits of code from the nginx directives.

    BUT ISPCFG fails to save the code, instead writes the directives I just saved into *.vhost.err and keeps the old/wrong vhost which contains the directives which break nginx.
    [email protected]:~# grep -R -i 'skip' /etc/nginx/
    /etc/nginx/sites-enabled/100-domain.tld.vhost:         fastcgi_cache_bypass $skip_cache;
    So the question is where does this "old code" come from, I mean this line of "fastcgi_cache_bypass $skip_cache;" which is precisely what I am trying to remove from all sites.

    I assume I cannot simply copy all .vhost.err files to .vhost as that wrong information is still stored somewhere inside the ISPCFG DB...
    And just for completeness sake although I doubt this matters: ISPCFG3 latest running on a Debian 8 perfect server with nginx.
    Last edited: May 29, 2016
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Check the template in /usr/local/ispconfig/server/conf/ too, maybe you edited both in the past.
  3. Ovidiu

    Ovidiu Active Member

    nope, I have checked already:
    [email protected]:/# grep -R -i 'skip'  /usr/local/ispconfig/server/conf/
    [email protected]:/#
    Any more ideas please? I'm stuck here with all .vhost files being "broken" and all .vhost.err files beeign the actually good version as I explained above :-/

    The reason I am always searching for skip is because that was part of the code I removed and what breaks nginx:
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Then your nginx config must contain an issue in another vhost which prevents a Nginx reload or restart. If you altered Nginx outside of ispconfig e.g. by changing the config or by removing a module that was previously used and this change causes an error, then ispconfig can not write new vhost files anymore as the Nginx config is globally invalid even if the local new config is ok, so Nginx will report an error and ispconfig has to roll back to the previous config.
  5. Ovidiu

    Ovidiu Active Member

    I'm pretty sure its not my nginx.conf as I can "manually" induce an error in it and that looks like this:
    [email protected]:/# nginx -t
    nginx: [emerg] "fastcgi_cache" zone "WORDPRESS" is unknown in /etc/nginx/nginx.conf:220
    nginx: configuration file /etc/nginx/nginx.conf test failed
    while currently it has problems like this:
    [email protected]:/# nginx -t
    nginx: [emerg] unknown "skip_cache" variable
    nginx: configuration file /etc/nginx/nginx.conf test failed
    as a line containing "skip"is present in all .vhost files.

    I think the situation is as follows:
    - I "correct" a site via ISPCFG Web Ui but before saving it tries a nginx -t test and that fails as all other vhost files have a problem so it can't save the correct vhost fiel and instead saves as .err I think my only chance is to make a backup of all .vhost files then replace them all with their .vhost.err files as those are working.

    Any problems you see with this?

Share This Page