ShaneTurner
3 years ago

Multiple Apps on one domain

Posted 3 years ago by ShaneTurner

I'm working on a project that has become very modular, and have contemplated splitting into an individual user facing application and separate admin/backend application.

In short I want all standard routes to point to the user app except for /admin/* which I want to use the admin app. This will be running off the same domain.

  • example.com/* -> user app
  • example.com/admin/* -> admin app

I've tried to get this working but can't figure out where the problem is. I'm guessing the nginx config.

server_name example.com;

root /var/www/userapp/public;

index index.html index.htm index.php;

location /admin {
    alias /var/www/adminapp/admin;
    try_files $uri $uri/ /index.php?$query_string;
}

location / {
    try_files $uri $uri/ /index.php?$query_string;
}
.
.
.

Please sign in or create an account to participate in this conversation.