A
A
Alexander Arbuzov2021-05-13 17:02:03
Nginx
Alexander Arbuzov, 2021-05-13 17:02:03

How to spread the addresses of subdirectories of one ip to different configs?

Slightly sloppy question in the title. Essence:
Nginx is running on the server, there are several services (sites) on it, each of which is in its own directory. The call looks like xxx.xxx.xxx.xxx/service_name.
The separation is done in the nginx config for different locations.

It is necessary to make sure that for each of the services there is a config.

I tried to make a separate config for each with a server section declaration, but since the call is by ip, I cannot create my own subdomain for each.

I tried to set an arbitrary domain name in server_name and turn everything to one ip through hosts, but it doesn’t take off either, nginx finds the first match and ignores the rest of the configs.

Is it possible to somehow make such a division?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lynn "Coffee Man", 2021-05-13
@arbuzzz

If the goal is simply to divide by files, then no one bothers to write include-s inside the server section.
In any case, you cannot write the location of one server in different server blocks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question