Различия

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

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

Предыдущая версия справа и слева Предыдущая версия
Следующая версия
Предыдущая версия
server:nginx [2016/01/12 09:14] – [Документация] mirocowserver:nginx [2021/12/31 01:22] (текущий) – [Рецепты / Рекомендации] mirocow
Строка 1: Строка 1:
 {{tag>nginx server}} {{tag>nginx server}}
  
-===== Настройка NGINX =====+===== NGINX =====
  
-  * [[nginx:nginx.conf|]] +  * [[nginx:nginx]] 
-===== Core =====+  * [[nginx:faq]] 
 +  * [[nginx:faq:locations]] 
 +  * https://www.nginx.com/resources/wiki/
  
-  * [[nginx:http|http]] 
-    * [[nginx:server|server]] 
-      * [[nginx:location|location]] 
-      * [[nginx:rewrite|rewrite]] 
-  * [[nginx:встроенные_переменные_nginx|Встроенные переменные nginx]] 
  
-===== Конструкции и их применение =====+==== Скрипт создания настроек сайта для Nginx ====
  
-  * [[if|if]] +Я очень давно разрабатываю web проекты и для их публикации использую nginx web сервер. За это время скопилось много рецептов использования этого замчательного web сервера. Но из за лени каждый раз писать настройки заново я создал скрипт позволяющий ускорить и упростить это муторное занятие.
-  * [[break|break]] +
-  * [[try_files|try_files]]+
  
 +  * [[debian:web-server:addsite]]
 +==== Параметры сервера ====
  
-===== Специфические настройки =====+  * client_max_body_size 
 +  * keepalive_timeout
  
-  * server_name_in_redirect off;+==== Встроенные переменные ====
  
-===== Modules =====+  * [[nginx:встроенные_переменные_nginx]] 
 +==== Конструкции и их применение ==== 
 + 
 +  * if - не использовать 
 +  * break 
 +  * try_files 
 + 
 +==== Модули / Modules ====
    
   * [[fastcgi_module|fastcgi_module]] - позволяет передавать запросы FastCGI-серверу   * [[fastcgi_module|fastcgi_module]] - позволяет передавать запросы FastCGI-серверу
Строка 36: Строка 41:
   * [[http://nginx.org/ru/docs/http/ngx_http_memcached_module.html|ngx_http_memcached_module]]   * [[http://nginx.org/ru/docs/http/ngx_http_memcached_module.html|ngx_http_memcached_module]]
   * [[http://nginx.org/ru/docs/http/ngx_http_headers_module.html|ngx_http_headers_module]]   * [[http://nginx.org/ru/docs/http/ngx_http_headers_module.html|ngx_http_headers_module]]
-  * [[http://nginx.org/ru/docs/http/ngx_http_fastcgi_module.html|ngx_http_fastcgi_module]] +  * [[nginx:fastcgi_module|]] 
- +  * [[https://github.com/openresty/lua-resty-redis|Lua redis client driver]] 
-====== Отладка location ====== +  * [[nginx:lua]]
- +
-  * [[Отладка|Отладка]] +
- +
-====== Оптимизация ====== +
- +
-  * [[Ссылки|Ссылки]] +
- +
-====== ALL ====== +
- +
-  * [[all|all]] +
- +
-====== Документация ====== +
- +
-  * http://nginx.org/ru/docs/ +
-  * http://forum.nginx.org/list.php?21 +
-  * http://wiki.opennet.ru/Nginx +
-  * http://www.xakep.ru/post/54168/?print=true +
-  * [[http://habrahabr.ru/post/163847/|Контролируемое кэширование страниц в nginx]] +
-  * [[nginx:встроенные_переменные_nginx|Встроенные переменные]] +
-  * [[nginx:ddos|]] +
-  * [[nginx:nginx_http_basic_authentication|Ограничение доступа средствами Nginx]] +
-  * [[http://habrahabr.ru/post/146179/|Оптимизация связки Nginx, Apache, PHP, MySql]] +
-  * [[http://habrahabr.ru/post/79876/|nginx + apache. Кеширование]] * +
-  * [[http://habrahabr.ru/post/160123/|WebSocket-чат на Tornado]] +
-  * [[http://highload.com.ua/index.php/2010/07/21/%D0%B8%D1%81%D0%BF%D0%BE%D0%BB%D1%8C%D0%B7%D1%83%D0%B5%D0%BC-nginx-%D0%BA%D0%B0%D0%BA-long-polling-comet-%D1%81%D0%B5%D1%80%D0%B2%D0%B5%D1%80/|Используем Nginx как «long polling» (Comet) сервер]] +
-  * [[nginx:documentations:proxy|Nginx proxy domain to another domain with no change URL]] +
-===== High Load ===== +
- +
-  * http://habrahabr.ru/search/?q=%5Bhighload%5D&target_type=qa +
-  * http://www.ozon.ru/context/detail/id/6284008/ +
-  * http://shop.oreilly.com/product/9780596518585.do +
-  * http://shop.oreilly.com/product/0636920022343.do +
-  * http://blog.denivip.ru/index.php/2010/10/openx-highload/ +
-  * http://www.insight-it.ru/blog/ +
-  * http://habrahabr.ru/post/113992/ +
-  * http://nbonvin.wordpress.com/2011/03/24/serving-small-static-files-which-server-to-use/ +
- +
- +
-===== Установка ===== +
- +
-===== Ubuntu ===== +
- +
-  * apt-get install libpcre3-dev libpcre3 zlib1g-dev +
- +
-==== Debian 6 ==== +
-<code> +
-# nginx +
-deb http://nginx.org/packages/debian squeeze nginx +
-deb-src http://nginx.org/packages/debian squeeze nginx +
-</code> +
- +
-=== ./configure === +
- +
-Без прокси +
-<code conf> +
-./configure --prefix=/usr --sbin-path=/usr/sbin/nginx  --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-pcre --without-http_proxy_module --with-http_gunzip_module --with-aio_module --lock-path=/var/run/nginx.lock --with-http_gzip_static_module +
-</code> +
- +
-<code conf> +
-./configure --prefix=/usr --sbin-path=/usr/sbin/nginx  --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --pid-path=/var/run/nginx.pid --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --with-pcre --with-http_gunzip_module --with-aio_module --lock-path=/var/run/nginx.lock --with-http_gzip_static_module +
-</code> +
-==== PPA ==== +
-<code> +
-  distr=squeeze +
-  nginx=stable # use nginx=development for latest development version +
-</code>+
  
-<code> +===== Рецепты Рекомендации =====
-echo "deb http://ppa.launchpad.net/nginx/$nginx/ubuntu $distr main" > /etc/apt/sources.list.d/nginx-$nginx-$distr.list +
-apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C300EE8C +
-apt-get update  +
-apt-get install nginx +
-</code>+
  
-====== Видеоруки / Статьи ======+  * [[nginx:redirect-www|Создание 301 редиректа на домен с www]] 
 +  * [[nginx:redirect-without-slash|Создание редиректа со слеша на без слеша]] 
 +  * [[nginx:proxy-inside|Проксирование запроса на внутренний сервер]] 
 +  * [[nginx:proxy-outside|Проксирование запроса на внешний сервер]] 
 +  * [[nginx:run-php|Запуск php скриптов]] 
 +  * [[nginx:run-python|Запуск python скриптов]] 
 +  * [[nginx:run-ruby|Запуск ruby скриптов]] 
 +  * [[nginx:proxy-node|Проксирование запроса на node]] 
 +  * [[nginx:proxy-ws|Проксирование запроса на websocket]] 
 +  * [[nginx:кеширование]] 
 +    * [[nginx:cache|Кеширование локации]] 
 +  * [[nginx:basic-access-authentication|Закрытие доступа с помощью веб авторизации]] 
 +  * [[nginx:ограничение_доступа_средствами_nginx|]] 
 +  * [[nginx:настройка_ssl_https_в_nginx|]] 
 +  * [[nginx:gzip|Настройка GZIP сжатия данных сайта]] 
 +  * [[nginx:KEYEXPIRED|KEYEXPIRED]] 
 +  * [[nginx:alias|Перенаправление обработки скрипта в другую папку]] 
 +  * [[nginx:robots.txt]] 
 +  * https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#
  
-  * [[https://xakep.ru/2010/12/15/54168/|Полный тюнинг движка: Делаем непробиваемый Nginx сервер]] +===== Примеры конфигураций =====
-  * [[http://vas3k.ru/blog/300/|Управляемая раздача файлов через nginx]] +
-  * http://habrahabr.ru/post/142648/+
  
 +  * [[nginx:виртуальные_хосты|Drupal]]
 +  * [[nginx:yii2|Yii2]]
 +  * [[nginx:example1]]
 +  * https://github.com/elasticweb/nginx-configs/tree/master/configs
 +  * [[http://symfony.com/doc/3.4/setup/web_server_configuration.html|symfony]]
 +  * https://andrey.4devs.io/ru/working-environment/yosemite-php-nginx-mongodb-nodejs.html
 +  * https://ahrameev.ru/article/superskorostnojj-symfony-s-pomoshhyu-nginx.html
 +  * https://amylabs.ru/post/ustanovka-orocrm.html