A
A
Arx7772015-10-18 17:04:10
linux
Arx777, 2015-10-18 17:04:10

Setting up nginx virtual hosts?

How to configure nginx so that it reads not the config /etc/nginx/nginx.conf, but the Wirth configs. hosts from /etc/nginx/conf.d/*
ie so I can create a 1> virtual host?
In other words, not to /etc/nginx/nginx.confprescribe configs for all Wirth. hosts, and so that there is /etc/nginx/conf.d/a config for your virtual host separately ( /etc/hostalready registered)
PS I apologize right away for a stupid question, but on the net I could only find the settings for the old nginx, where the virtual hosts are located in /etc/nginx/sites-available/and they are activated through the command

sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled/
I just don't have those folders :D

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Skobkin, 2015-10-18
@skobkin

## /etc/nginx/nginx.conf 
# ...
http {
    # ...
    include /etc/nginx/sites-enabled/*.conf;
    # ...
}
# ...

You can change the path here to /etc/nginx/conf.d/*.conf - nothing fundamentally changes at all. And the two directories also have their own plus - you can remove the symlink and leave the config as it is without even changing its name.
And why is this at all? It has nothing to do with nginx. Or do you send everything to 127.0.0.1 locally for development?
Yes, but there's nothing you can do about it. After all, probably, even mkdir does not work for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question