I have been looking online for some time but unable to find a definitive answer to this in terms of best practice and extracting the pro's and cons has been difficult.
I have multiple apps / locations that I wish to serve via an nginx reverse proxy
app1 is pure static files i.e. js/html/css etc app2 and app3 are wsgi applications
My current solution uses subdomains to differentiate in terms of routing
example.com -> app1
app2.example.com -> app2
app3.example.com -> app3
Then I have different server blocks in my nginx configuration for each application based on server name.
This works well, however I am aware of the alternative of achieving the split via routes i.e.
example.com/ -> app1
example.com/app2/ -> app2
example.com/app3/ -> app3
Which is better practice? the lack of subdomains makes CORS/Session cookie management easier as well as not requiring multiple DNS records for the subdomains. Are there downsides to the route approach? Both these approaches seem to be implemented around the web so what is the deciding factor.