Mass update all hosts because of change in nginx template file

Discussion in 'General' started by kresimir, Nov 2, 2023.

  1. kresimir

    kresimir New Member

    Hi,

    I have all of my nginx host config files located on my ubuntu in default location:

    /etc/nginx/sites-availabable/*.vhost

    and I would like to make a change on all of them by removing default directive for robots:

    location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
    }


    because I will handle it for all hosts in my master include nginx file like this:

    [​IMG]


    I did make a change to /usr/local/ispconfig/server/conf-custom/install/nginx_vhost.conf.master and removed robots directive - for new hosts that I'll add,, but is there any recommended way to remove this old robots directive from current hosts?

    I know that I can open, edit and save directly vhost files, but I'm interested to know is that the correct way..

    Thanks, Kres
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    The correct way is to use Tools > Resync in ISPConfig.
     
  3. kresimir

    kresimir New Member

    Thank you Till for fast response..

    I havent used Resync before with ISPConfig, don't know how exactly it works (guess it syncs nginx_vhost.conf.master with all hosts, but how changes are handled?) - if there is some suggested documentaion online I'd like to visit it definitly.

    Kindly, Kres
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Resync is basically the same as if you would open each site, change a value and save it, one after another. So it enforces an update of the configuration based on what is in the ISPConfig database and the templates of the config files.
     
  5. kresimir

    kresimir New Member

    Hm,, but I don't see robots option in site settings

    That is only in nginx_vhost.conf.master directly entered, and all my sites have it in nginx config file..
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Just noticed you put xour custom template into the wrong folder, the correct location is:

    /usr/local/ispconfig/server/conf-custom/nginx_vhost.conf.master

    The folder /usr/local/ispconfig/server/conf-custom/install/ is for the installer only, and the template you changed is not an installer template.
     
  7. kresimir

    kresimir New Member

    /usr/local/ispconfig/server/conf-custom/nginx_vhost.conf.master​
    thank you very much for path correction!
     
  8. kresimir

    kresimir New Member

    Thank you very much Till, Resync resolved my issue!

    Thread close
     

Share This Page