Friday 24 November 2017

question about requests from node app with nginx on top

I have a nodeJS front end application that has nginx on top. The nginx is configured such that the the front end, as well as several other REST services are all under one domain. I.e. the front end would be site.com, and the services would be site.com/api/. The front end is simply calling ajax with a url without the whole host name...i.e. fetch('/api') I also need to make some calls on the front end's server side to the other services. However, with the request library, I cannot make a call without the full URL. I have two options.1) Set the full URL to be the common one that NGINX proxies all traffic from....i.e. my request on the front end server would to go site.com/api,2) I would call the actual URL of those services.Any advice? Thanks in advance.

Submitted November 24, 2017 at 08:14PM by rhetoricl

No comments:

Post a Comment