Simple example of configuration of a nginx server where the config file for nginx is a jinja template drawing from custom Grains (https://docs.saltstack.com/en/latest/topics/grains/index.html#writing-grains).
Please keep in mind default path to custom Grains directory: /srv/salt/_grains