yii2+nginx, subdomain to module

I have a project working on yii2 (backend nginx). The project has several modules, it can be conditionally called:

It is required to implement the functionality so that when requesting cat1.coolsite.example, it opens a module that is available as coolsite.example/cat1. Accordingly, the second category

Upvotes: 0

Views: 331

Answers (1)

wormi4ok
wormi4ok

Reputation: 632

Try adding 2 server configs for your modules like this one and look at nginx error.log if it doesn't do the trick.

server {

    listen 80;

    server_name cat1.coolsite.example,;

    location / {
            proxy_pass coolsite.example/cat1/$uri;
    }
}

Upvotes: 1

Related Questions