I am new to server stuff, i want to host multiple rest service using docker and nginx.
Let's say i have three service that runs on 8180, 8181 and 8182. I am able to forward request to one port but i have no idea how to tell nginx to forward to specific ports based on the url.
Lets say:
https://testsite.com/api/v1/products -> access product service
https://testsite.com/api/v1/orders -> access order service
https://testsite.com -> access webpage (vuejs)
Do i need to create api-gateway and route them by its url and runit inside docker?
Are there any best practice on how to this?
Thanks.
serverblock to handlehttps://testsite.comand then within it, multiplelocationblocks for different URL patterns so that requests can be forwarded to services (proxy_pass). There are books and tutorials you can find over the internet, and examples like https://www.nginx.com/resources/wiki/start/topics/examples/full/ – Lex Li Dec 15 '22 at 06:50