I'm in charge of setting up a testing server in which all web applications should respond to a single domain, like this, for example:


What I want to do is to be able to pass the location of a different app and still be in the same domain, like so:




and I want to do it with Nginx, wich is the tool that I'm using. Problem is, I can only add them as diffent subdomains. I tried a few ways like putting all apps in one folder and trying to rename them all, with no luck. I have no idea how to achieve what I want and I already searched for weeks on end with nothing to help me achieve this. Some help would be greatly appreciated!

1 Answer 1


Use can use the location tag for that. Edit your configuration file under /etc/nginx/sites-enabled, and add a location tag for each sub-site

server {
    location / {
        root /path/to/default;

    location /thisapp/ {
        root /path/to/thisapp;

    location /differentapp/ {
        root /path/to/differentapp;

You can read more in the nginx beginners guide

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.