Показать страницуИстория страницыСсылки сюдаCopy this pageExport to MarkdownODT преобразованиеНаверх Вы загрузили старую версию документа! Сохранив её, вы создадите новую текущую версию с этим содержимым. Медиафайлы{{tag>nginx server}} ===== Настройка NGINX ===== * [[nginx:nginx.conf|]] ===== Core ===== * [[nginx:http|http]] * [[nginx:server|server]] * [[nginx:location|location]] * [[nginx:rewrite|rewrite]] * [[nginx:встроенные_переменные_nginx|Встроенные переменные nginx]] ===== Конструкции и их применение ===== * [[if|if]] * [[break|break]] * [[try_files|try_files]] ===== Специфические настройки ===== * server_name_in_redirect off; ===== Modules ===== * [[fastcgi_module|fastcgi_module]] - позволяет передавать запросы FastCGI-серверу * [[fastcgi_module:cache|Caxhe]] * [[http://nginx.org/ru/docs/http/ngx_http_map_module.html|map_module]] -создаёт переменные, значения которых зависят от значений других переменных * [[ngx_cache_purge|ngx_cache_purge]] - очистка кеша по заданным uri * [[geoip|geoip]] - Определение ГЕО локации по IP * [[http://nginx.org/ru/docs/http/ngx_http_limit_req_module.html|limit_req_module]] * [[http://nginx.org/ru/docs/http/ngx_http_core_module.html|ngx_http_core_module]] * [[http://nginx.org/ru/docs/http/ngx_http_rewrite_module.html|ngx_http_rewrite_module]] * [[http://nginx.org/ru/docs/http/ngx_http_proxy_module.html|ngx_http_proxy_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_fastcgi_module.html|ngx_http_fastcgi_module]] ====== Отладка location ====== * [[Отладка|Отладка]] ====== Оптимизация ====== * [[Ссылки|Ссылки]] ====== 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]] * [[nginx:documentations:proxy|]] ===== На английском ===== ====== Трюки ====== ===== На русском и конфигурация ===== * [[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) сервер]] * https://habrahabr.ru/post/272381/ ===== На английском ===== * https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/ * https://github.com/h5bp/server-configs-nginx * https://www.nginx.com/resources/admin-guide/ ===== High Load ===== * http://habrahabr.ru/post/198982/ :!: * 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> ====== Видеоруки / Статьи ====== * [[https://xakep.ru/2010/12/15/54168/|Полный тюнинг движка: Делаем непробиваемый Nginx сервер]] * [[http://vas3k.ru/blog/300/|Управляемая раздача файлов через nginx]] * http://habrahabr.ru/post/142648/ СохранитьПросмотрРазличияОтменить Сводка изменений Примечание: редактируя эту страницу, вы соглашаетесь на использование своего вклада на условиях следующей лицензии: CC0 1.0 Universal