From 7db0de6edae14c1c82b485e89d1bb75b0d5049a8 Mon Sep 17 00:00:00 2001 From: Arity-T Date: Sat, 1 Feb 2025 16:50:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=81=D0=B0=D0=B9=D1=82=D0=B0=20Nginx?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/servers/nginx.md | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/docs/servers/nginx.md b/docs/servers/nginx.md index b9f7935..ed8426d 100644 --- a/docs/servers/nginx.md +++ b/docs/servers/nginx.md @@ -1,10 +1,41 @@ +## Добавление сайта +Создаём конфиг. + +=== "Терминал" + + ```sh + sudo nano /etc/nginx/sites-available/new-site.conf + ``` + +=== "Пример конфига" + + ```nginx + server { + server_name example.com www.example.com; + listen 80; + + root /var/www/new-site; + index index.html; + + location / { + try_files $uri $uri/ =404; + } + } + ``` + +Активируем конфиг. + +```sh +sudo ln -s /etc/nginx/sites-available/new-site.conf /etc/nginx/sites-enabled/ +sudo systemctl reload nginx.service +``` ## SSL-сертификат с certbot !!! tip "Актуальная версия Python" - Обычно системый `Python` достаточно старый. Для установки `certbot` может потребоваться более новая версия. Минимальные требования можно узнать на [pypi](https://pypi.org/project/certbot/). + Обычно системный `Python` достаточно старый. Для установки `certbot` может потребоваться более новая версия. Минимальные требования можно узнать на [pypi](https://pypi.org/project/certbot/). ```sh sudo apt update