简体   繁体   中英

Multiple applications on one domain

SITUATION

Let's say I have a domain example.com . I want to write a main application using Node.js and some components using Golang.

QUESTIONS

Is it possible to run api.example.com/first using Node.js and api.example.com/second using Golang ? Or is it possible to write run different applications on different subdomains?

  • I'm not talking about executing Golang programmes through Node.js

Best way I can think of is to:

  1. Setup a reverse proxy such as Nginx
  2. Run it on port 80 and 443 (for HTTPS)
  3. Run you applications on different ports and bind to loopback IP address (127.0.0.1 usually)
  4. Define your reverse proxy routes in Nginx to match your applications

Check out this tutorial on how to do the previous: https://flaviocopes.com/go-nginx-reverse-proxy/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM