Инструменты пользователя

Инструменты сайта


nginx

Различия

Показаны различия между двумя версиями страницы.

Ссылка на это сравнение

Следующая версия
Предыдущая версия
nginx [18.09.2025 12:54] – создано kubadanginx [18.09.2025 16:15] (текущий) kubada
Строка 1: Строка 1:
-# 
-https://gist.github.com/beatfactor/a093e872824f770a2a0174345cacf171?permalink_comment_id=5370199#gistcomment-5370199 
- 
 === Установка === === Установка ===
 <code bash> <code bash>
Строка 19: Строка 16:
 ./configure --prefix=/usr/local/nginx --with-pcre=../pcre2-10.46/ --with-openssl=../openssl-3.5.2/ --with-http_ssl_module ./configure --prefix=/usr/local/nginx --with-pcre=../pcre2-10.46/ --with-openssl=../openssl-3.5.2/ --with-http_ssl_module
  
-sudo make && make install+make && sudo make install
 </code> </code>
  
Строка 52: Строка 49:
 <code bash> <code bash>
 sudo nano /etc/systemd/system/nginx.service sudo nano /etc/systemd/system/nginx.service
 +</code>
  
 +<code bash>
 [Unit] [Unit]
 Description=The NGINX HTTP and reverse proxy server Description=The NGINX HTTP and reverse proxy server
Строка 66: Строка 65:
 [Install] [Install]
 WantedBy=multi-user.target WantedBy=multi-user.target
 +</code>
  
 +<code bash>
 sudo systemctl daemon-reload sudo systemctl daemon-reload
- 
 sudo systemctl enable nginx sudo systemctl enable nginx
 sudo systemctl start nginx sudo systemctl start nginx
Строка 80: Строка 80:
 curl localhost curl localhost
 </code> </code>
 +
 +=== Certbot ===
 +<code bash>
 +sudo python3 -m venv /opt/certbot/
 +sudo /opt/certbot/bin/pip install --upgrade pip
 +
 +sudo /opt/certbot/bin/pip install certbot certbot-nginx
 +
 +sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
 +
 +certbot certonly --nginx --nginx-ctl /usr/local/nginx/sbin/nginx --nginx-server-root /usr/local/nginx/conf
 +</code>
 +
 +=== auth_basic ===
 +<code bash>
 +sudo sh -c "echo -n 'sammy:' >> /usr/local/nginx/.htpasswd"
 +sudo sh -c "openssl passwd -apr1 >> /usr/local/nginx/.htpasswd"
 +
 +auth_basic "You shall not pass!";
 +auth_basic_user_file /usr/local/nginx/.htpasswd;;
 +</code>
 +
 +[[https://gist.github.com/beatfactor/a093e872824f770a2a0174345cacf171?permalink_comment_id=5370199#gistcomment-5370199|gistcomment-5370199]]
 +
nginx.1758189272.txt.gz · Последнее изменение: kubada