How to create an NGINX configuration template (3.x and above)


Updating the nginx.conf file directly is not the correct procedure as any new changes made to the file will only get reverted to its original values whenever applying new changes via 'gadmin config apply'.

In order to prevent this from happening, you will need to create an NGINX configuration template of the nginx.conf file.

Note: The following procedure is for TigerGraph 3.x. Please use corresponding 3.x NGINX templates below.


1.Create a new nginx configuration template (name it nginx.conf.template) under the same location as the original nginx.conf file:

cd $(gadmin config get System.DataRoot)/configs/nginx/conf
gadmin config get Nginx.ConfigTemplate > nginx.conf.template
vim nginx.conf.template

2.Depending on which version of TigerGraph you are running (e.g. 3.1.1, 3.1.5, etc), download the relevant template that is attached to this article and save it as nginx.conf.template. a.Make necessary additions, updates, deletions to the nginx.conf.template. b.Some sample configs that can be added/updated/deleted: i.ssl_ciphers HIGH:!aNULL:!MD5; ii.ssl_protocols TLSv1.2 TLSv1.3; iii.fastcgi_read_timeout 72000s; ##note there are two instances of fastcgi_read_timeout. update both c.Save file 3.Map location of the new NGINX configuration template:

gadmin config entry Nginx.ConfigTemplate
Enter the following value:
@/<Tigergraph DataRoot Directory>/configs/nginx/conf/nginx.conf.template
    **<Tigergraph DataRoot Directory> = $(gadmin config get System.DataRoot)**
4.Apply configuration and restart nginx:
    gadmin config apply -y && gadmin restart nginx

5.Confirm that new changes are in place. [source,bash] grep <whatever you added/updated> $(gadmin config get System.DataRoot)/configs/nginx/nginx.conf