I have what seems like a simple setup but I have yet to find a solid example of what I am trying to accomplish or if it is even an issue.
What I am trying to set up:
- NGINX (one instance)
- Vuejs/React SPA (served by NGINX as static content)
- Express/Other Nodejs API (proxied to by NGINX)
- Postgres (accessed by API)
The only similar setup I could find online seemingly has two instances of nginx running; one to serve the client-side app and another to proxy to the api. Is this typically how you would set this up? I feel like I should be sharing the NGINX instance but am not sure how to set up my boxfile properly for that.
This is the closest example I could find but it seems to require two NGINX instances and two separate cofigurations:
nginx: nginx -c /app/nginx/client.conf
client: npm start
nginx: nginx -c /app/nginx/server.conf
api: bundle exec puma -C config/puma.rb
Found here: https://medium.com/@mendelh1537/deployment-rails-api-and-react-spa-on-digital-ocean-with-nanobox-io-d5625407a9cd
Thanks for any help