Multiple websites inside the same domain, Is this possible?

Hi everyone and thanks in advance

I’ve currently made a website in Symfnony4 and used docker (I’m a newbie on docker, just got asked to use it) for setting it up in a PHP container and an Nginx container.

I gave the Ops intern access to a repo that has the app ready for production so that he can deploy it. He sais that the server we are using is going to host multiple websites and all of them have to be under the same domain name let say it’s “domain.com”, and therefore he asked me to change the routes of my app to “/app/route” so that the website is entirely inside “domain.com/app”. I changed this straight in my Symfony code since I’m unsure if this can be done in the Nginx docker container. I also had to change the public directory and put all the CSS, js and images inside an “app” directory, and change the corresponding references.

My app works fine when I’m in my computer in dev and when I “simulate prod (prod DB, prod ENV variables…)”, it works fine in the localhost. But now that it’s deployed, every time a user logins there’s a 500 server error

So my question is:

  • Do you have any idea of what’s wrong and how can this be fixed? (I don’t need specific answers if you don’t have them, something conceptual is welcomed bc I feel like I have some missing concepts here)

  • Does this have something to do with the “multiple websites in the same domain”

  • Is this the right way to handle the “multiple websites in the same domain” issue, or should it be a subdomain: app.domain.com instead of domain.com/app

hi Enna,
If yours is a standalone applciation it is better to use a subdomain for your application.
If you application is part of microservices, you can go for path based routing.
Both concepts are possible and it doesnt require much effors for the ops guy.
If its Nginx, its just configuration update in the virtual host file or if it is acting as proxy, just the upstream configration. Either way it shouldnt be complex