E
E
Egor Babintsev2020-05-12 15:18:43
Backend
Egor Babintsev, 2020-05-12 15:18:43

Where to store the server config when developing the backend?

Good afternoon. I’m just starting to get into the backend, so I don’t quite understand the intricacies of file organization. I'm planning to set up nginx as a proxy server for node and want to commit changes with git. But the main nginx config is stored in the /etc/nginx folder, and mine will be in the project folder, which will be in the home folder. Would it be correct to just store my configuration in the project folder and connect it to the main config via include? Thank you in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2020-05-21
@HeadOnFire

Store where it is more convenient, there are no hard restrictions. The config for a specific project can be in the project folder, in your home directory, in /etc/nginx/conf.d or /etc/nginx/sites-available - whichever you prefer. And it's absolutely fine to connect them from the main config - in fact, the default standard configuration does just that - it includes all configs from the conf.d folder.
The only point - try not to keep the nginx config in the root folder of the website so that it is not available through the web. Well, or at least close access to it in the same config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question