I've one domain: example.com and multiple projects: proj1, proj2, proj3. Every project has its own API and INTERNAL panel. Could you please suggest me the right DNS/Nginx configuration for this situation?
OPTION 1
server_name api.example.com
location /proj1/v1.0 {
root /proj1/api/v1.0
}
location /proj2/v1.0 {
root /proj2/api/v1.0
}
location /proj3/v1.0 {
root /proj3/api/v1.0
}
----------------------------------
server_name internal.example.com
location /proj1 {
root /proj1/internal
}
location /proj2 {
root /proj2/internal
}
location /proj3 {
root /proj3/internal
}
OPTION 2
server_name proj1.example.com
root /proj1
location /api/v1.0 {
}
location /internal {
}
----------------------------------
[...] the same for the proj2 and proj3
Should I go for the multiple locations or multiple subdomains strategy? Any other solution?