• Questions
  • How to create custom nginx configurations?

Anyone to help me on how to create custom nginx configuration

  • VirtuBox replied to this.
  • Hello elijahndege,

    1. If you want to customize WordOps Nginx configuration, just edit them with your preferred text editor and create an empty file with the same name and the extension .custom to make sure WordOps will not overwrite your custom configuration.

    Example :

    # edit the common rules for static files
    nano /etc/nginx/common/locations-wo.conf
    
    # create a .custom file
    touch /etc/nginx/common/locations-wo.conf.custom

    2. If you want to edit a site configuration, you can use the command wo site edit site.tld or put your additional configuration inside a .conf file in the directory /var/www/site.tld/conf/nginx

    Hello elijahndege,

    1. If you want to customize WordOps Nginx configuration, just edit them with your preferred text editor and create an empty file with the same name and the extension .custom to make sure WordOps will not overwrite your custom configuration.

    Example :

    # edit the common rules for static files
    nano /etc/nginx/common/locations-wo.conf
    
    # create a .custom file
    touch /etc/nginx/common/locations-wo.conf.custom

    2. If you want to edit a site configuration, you can use the command wo site edit site.tld or put your additional configuration inside a .conf file in the directory /var/www/site.tld/conf/nginx

      @VirtuBox once a custom file has been set, how would we know if there are maintaner updates to a file? Such that you might make a change to locations-wo.conf for optimizations, but otherwise we might be unaware of those changes because of the .custom file

      TIA! Awesome platform you've made and love it. Great to see it continuing to mature.

        Hello jond1,
        Another config file with the .orig extension will be created, so you will be able to compare them easily with diff.
        Example :

        diff /etc/nginx/common/locations-wo.conf /etc/nginx/common/locations-wo.conf.orig

        Ah, good to know. Would be great to do a diff during the upgrade process, similar to that of Ubuntu (and other flavors) do during a grub update where you can choose which option to, view the diff, keep the current, use the maintainers, etc.

        Hosted by VirtuBox