Latest 3.1 nginx Template

In a KB article about enabling CORS there is a template for nginx for TG 3.1 (https://tigergraph.freshdesk.com/support/solutions/articles/5000867412). I’ve noticed odd behavior when using the linked 3.1 template at the bottom of the article with 3.1.1. There seems to be some issue on the routing for queries with parameters. For example in the graph exploration view limits for a vertex type aren’t being honored. Running queries through Graph Studio is a similar experience, the parameters from the input aren’t being passed correctly.

If I don’t use the nginx template everything works fine and as expected. I’m looking for the most up to date template to compare. I couldn’t find in the docker container, and running “gadmin config entry Nginx.ConfigTemplate” gives the below message.

Nginx.ConfigTemplate [ ]: The template to generate nginx config. Please use @filepath to parse template from file. Check the default template first at https://docs.tigergraph.com./(Warning: Don’t modify the reserved keywords(string like UPPER_CASE) in template.). Didn’t see this anywhere in the documentation.

I’ve dug into this a little bit more and tested some things through Postman as well as looking at the linked template.

Relevant documentation:
https://docs.tigergraph.com/dev/restpp-api/built-in-endpoints#run-an-installed-query-get
https://docs.tigergraph.com/dev/restpp-api/built-in-endpoints#run-an-installed-query-post

Executing a query through Graph Studio will send GET request, but as opposed to the above documentation the request will be rerouted from

tigergraph_url:14240/restpp/query/graph_name/query_name?query_param

Through Postman I’ve noticed that query_param is ignored. However if the query_param is instead sent as a JSON in the request body then everything seems to work.

However targeting
tigergraph_url:9000/query/graph_name/query_name?query_param
with GET does respect the query param, which makes sense as the linked nginx 3.1 template keys off of /restpp/. Nothing is rewriting the request param as the request body.

I did notice however that even as GET, if a JSON request body is included then it overrides query_parameter when targeting the non /restpp/ endpoint.

The nginx template in the linked article I think needs to be updated to account for the above, otherwise strictly going through Graph Studio will be problematic with the above template. Is there a more updated template available? Everything works fine if I don’t set the template, so is there a default template that comes packaged with the docker container? If so, can anyone point to the file location of that template in the container?

Hi @rpguidr,

You can find the latest Nginx template for 3.1.1 here:

Hope this helps. :blush:

1 Like

Yes, thank you. Just what I was looking for I was able to compare the template from that article with the one I linked. Confirmed what I was thinking.