SlideShare a Scribd company logo
study2study #4
-Nginx                        -
                   @n0ts
             Naoya NAKAZAWA
                 11/11/2011
who?

• @n0ts
• Naoya NAKAZAWA
•
  • 22.5 /
Study2study#4 nginx conf_1_24
nginx.conf
http://wiki.nginx.org/
 NginxFullExample
       line 1-24
line 1


user www www;
user www www;
       line 1

               : nobody nobody

                     root
setuid()/setguid()
line 2


worker_processes 5;
line 2
worker_processes 5;

      : wroker_processes <           >

            :1



CPU                          nginx
CPU
worker_processes 5;
      cont ;
 - SMP

 -                   I/O


 - select()/poll()           1
                           events
line 3


error_log logs/error.log;
error_log logs/error.log;
                                  line 3
    : error_log <                  > [ debug | info | notice | warn | error | crit ]

              : ${prefix}/logs/error.log

                   (fastcgi         )




  - main               : error

  - HTTP                 : crit

  - server                : crit

VirtualHost
line 4


pid logs/nginx.pid;
pid logs/nginx.pid;
                  line 4

      : pid <          >

PID

                           HUP

 # kill -HUP `cat logs/nginx.pid`
line 5


worker_rlimit_nofile 8192;
worker_rlimit_nofile 8192;
               line 5

  : worker_rlimit_nofile <   >

        :        OS
line 7


events {
events {
                 line 7
Events

Nginx

accept_mutex, accept_mutex_delay,
debug_connection, devpoll_changes, devpoll_events,
kqueue_changes, kqueue_events, epoll_events,
multi_accept, rtsig_signo, rtsig_overflow_events,
rtsig_overflow_test, rtsig_overflow_threshold, use,
worker_connections
line 8


worker_connections 4096;
worker_connections 4096;
                    line 8
    : worker_connections <                 >

           : ?

max_clients = worker_processes * worker_connections



max_clients = worker_processes * worker_connectins / 4
line 9


}
}
    line 9
line 11


http {
http {
             line 11


HTTP

Nginx HTTP


64
line 12


include conf/mime.types;
include conf/mime.types;
                   line 12
     : include <          >

            :



v0.4.4


 include vhosts/*.conf;
line 13


include /etc/nginx/proxy.conf;
include /etc/nginx/proxy.conf;
         line 13
line 14


include /etc/nginx/fastcgi.conf
include /etc/nginx/fastcgi.conf
          line 14
line 15


index index.html index.htm index.php;
line 15
index index.html index.htm index.php;


   : index <                 >

          : index.html
line 17


default type application/octet-stream;
line 17
default type application/octet-stream;



   : default_type <MIME       >

          text/plain

       MIME
                       MIME
line 18-20

log_format main

 '$remote_addr - $remote_user [$time_local] $status '

 '"$request" $body_bytes_sent "$http_referer" '

 '"$http_user_agent" "$http_x_forwarded_for"';
log_format main




                                    line 18-20
            '$remote_addr - $remote_user [$time_local] $status '

            '"$request" $body_bytes_sent "$http_referer" '

            '"$http_user_agent" "$http_x_forwarded_for"';

         : log_format <                      ><                    >

                      : log_format combined “...”



%b                                    Apache mod_log_config

combined
log_format combined ‘$remote_addr - $remote_user [$time_local] ‘

                    ‘“$request” $status $body_bytes_sent ‘

                    ‘“$http_referer” “$http_user_agent”’;
line 21


access_log logs/access.log main;
access_log logs/access.log main;
                    line 21
: access_log <      > [<         >[   =   ]] | off


          : log/access.log combined
line 22


sendfile on;
line
sendfile on;                 22


    : sendfile [on | off]

            : sendfile off

sendfile()
line 23


tcp_nopush on;
tcp_nopush on;
                  line 23
   : tcp_nopush [on | off]

          : off

                         FreeBSD
TCP_NOPUSH              Linux      TCP_CORK


                   sendfile
line 24


server_name_hash_bucket_size 128;
server_name_hash_bucket_size 128;
              line 24
   : server_names_hash_bucket_size   >

         : 32/64/128




              CPU
Study2study#4 nginx conf_1_24
Thanks!

More Related Content

What's hot (20)

PDF
OpenResty TCP 服务代理和动态路由
Orangle Liu
 
PDF
OSMC 2014: Monitoring VoIP Systems | Sebastian Damm
NETWAYS
 
PDF
Php assíncrono com_react_php
Renato Lucena
 
PDF
Lua tech talk
Locaweb
 
PDF
The new features of PHP 7
Zend by Rogue Wave Software
 
PDF
Key features PHP 5.3 - 5.6
Federico Damián Lozada Mosto
 
PDF
Using ngx_lua in UPYUN
Cong Zhang
 
PDF
Roll Your Own API Management Platform with nginx and Lua
Jon Moore
 
PPTX
A new way to develop with WordPress!
David Sanchez
 
PDF
Protobuf & Code Generation + Go-Kit
Manfred Touron
 
KEY
skipfish
Christian Heinrich
 
PDF
PHP7 - Scalar Type Hints & Return Types
Eric Poe
 
PDF
What is new in Go 1.8
John Hua
 
PDF
Monitoring with Syslog and EventMachine
Wooga
 
PDF
Centralized Logging with syslog
amiable_indian
 
PDF
Lumberjack XPath 101
Thomas Weinert
 
PDF
Codified PostgreSQL Schema
Sean Chittenden
 
PDF
Pursue container architecture with mincs
Yuki Nishiwaki
 
PDF
Server Side Event Driven Programming
Kamal Hussain
 
OpenResty TCP 服务代理和动态路由
Orangle Liu
 
OSMC 2014: Monitoring VoIP Systems | Sebastian Damm
NETWAYS
 
Php assíncrono com_react_php
Renato Lucena
 
Lua tech talk
Locaweb
 
The new features of PHP 7
Zend by Rogue Wave Software
 
Key features PHP 5.3 - 5.6
Federico Damián Lozada Mosto
 
Using ngx_lua in UPYUN
Cong Zhang
 
Roll Your Own API Management Platform with nginx and Lua
Jon Moore
 
A new way to develop with WordPress!
David Sanchez
 
Protobuf & Code Generation + Go-Kit
Manfred Touron
 
PHP7 - Scalar Type Hints & Return Types
Eric Poe
 
What is new in Go 1.8
John Hua
 
Monitoring with Syslog and EventMachine
Wooga
 
Centralized Logging with syslog
amiable_indian
 
Lumberjack XPath 101
Thomas Weinert
 
Codified PostgreSQL Schema
Sean Chittenden
 
Pursue container architecture with mincs
Yuki Nishiwaki
 
Server Side Event Driven Programming
Kamal Hussain
 

Similar to Study2study#4 nginx conf_1_24 (20)

PPTX
NGINX: Basics and Best Practices
NGINX, Inc.
 
PPTX
NGINX 101 - now with more Docker
sarahnovotny
 
PPTX
NGINX 101 - now with more Docker
Sarah Novotny
 
PDF
httpd — Apache Web Server
webhostingguy
 
PDF
NginX - good practices, tips and advanced techniques
Claudio Borges
 
PPTX
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Amit Aggarwal
 
PDF
Using NGINX as an Effective and Highly Available Content Cache
Kevin Jones
 
PDF
Best Practices for Getting Started with NGINX Open Source
NGINX, Inc.
 
PPTX
How to Avoid the Top 5 NGINX Configuration Mistakes
NGINX, Inc.
 
PPTX
How to Avoid the Top 5 NGINX Configuration Mistakes.pptx
NGINX, Inc.
 
KEY
Nginx - Tips and Tricks.
Harish S
 
PPTX
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX, Inc.
 
PDF
ApacheConNA 2015: What's new in Apache httpd 2.4
Jim Jagielski
 
PDF
Deploying nginx with minimal system resources
Max Ukhanov
 
PDF
Nginx pres
James Fuller
 
PPTX
High Availability Content Caching with NGINX
NGINX, Inc.
 
PDF
High Availability Content Caching with NGINX
Kevin Jones
 
PDF
Nginx维护手册
Lei Yang
 
PDF
NGINX: Basics and Best Practices EMEA
NGINX, Inc.
 
ODP
Apache httpd 2.4: The Cloud Killer App
Jim Jagielski
 
NGINX: Basics and Best Practices
NGINX, Inc.
 
NGINX 101 - now with more Docker
sarahnovotny
 
NGINX 101 - now with more Docker
Sarah Novotny
 
httpd — Apache Web Server
webhostingguy
 
NginX - good practices, tips and advanced techniques
Claudio Borges
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Amit Aggarwal
 
Using NGINX as an Effective and Highly Available Content Cache
Kevin Jones
 
Best Practices for Getting Started with NGINX Open Source
NGINX, Inc.
 
How to Avoid the Top 5 NGINX Configuration Mistakes
NGINX, Inc.
 
How to Avoid the Top 5 NGINX Configuration Mistakes.pptx
NGINX, Inc.
 
Nginx - Tips and Tricks.
Harish S
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX, Inc.
 
ApacheConNA 2015: What's new in Apache httpd 2.4
Jim Jagielski
 
Deploying nginx with minimal system resources
Max Ukhanov
 
Nginx pres
James Fuller
 
High Availability Content Caching with NGINX
NGINX, Inc.
 
High Availability Content Caching with NGINX
Kevin Jones
 
Nginx维护手册
Lei Yang
 
NGINX: Basics and Best Practices EMEA
NGINX, Inc.
 
Apache httpd 2.4: The Cloud Killer App
Jim Jagielski
 
Ad

More from Naoya Nakazawa (18)

PDF
お手軽に使おう Alibaba Cloud - OSS 編 -
Naoya Nakazawa
 
PDF
DATADOG TIPS #1
Naoya Nakazawa
 
PDF
kumogata-template の紹介
Naoya Nakazawa
 
PDF
はじめての Gatling
Naoya Nakazawa
 
PPTX
はじめての datadog
Naoya Nakazawa
 
KEY
Monit & Supervisord Tips
Naoya Nakazawa
 
KEY
ぼくがかんがえたさいきょうの☆きっくすたーと☆
Naoya Nakazawa
 
PDF
データセンター移行に伴い、 MySQLをカジュアルにアップグレードしたお話
Naoya Nakazawa
 
KEY
Apache 2.4 ChangeLog at 闇Webサーバ勉強会#5
Naoya Nakazawa
 
KEY
/etc/rc.d配下とかのリーディング勉強会
Naoya Nakazawa
 
PDF
fastcgi_conf and mime_types
Naoya Nakazawa
 
KEY
mod_security introduction at study2study #3
Naoya Nakazawa
 
PDF
httpd.conf line 1 to 7, 24
Naoya Nakazawa
 
KEY
puppet @techlifecookpad
Naoya Nakazawa
 
PDF
zsh最強シェル入門読書会1
Naoya Nakazawa
 
KEY
Velocity Report 2009
Naoya Nakazawa
 
PDF
Mac Ports
Naoya Nakazawa
 
お手軽に使おう Alibaba Cloud - OSS 編 -
Naoya Nakazawa
 
DATADOG TIPS #1
Naoya Nakazawa
 
kumogata-template の紹介
Naoya Nakazawa
 
はじめての Gatling
Naoya Nakazawa
 
はじめての datadog
Naoya Nakazawa
 
Monit & Supervisord Tips
Naoya Nakazawa
 
ぼくがかんがえたさいきょうの☆きっくすたーと☆
Naoya Nakazawa
 
データセンター移行に伴い、 MySQLをカジュアルにアップグレードしたお話
Naoya Nakazawa
 
Apache 2.4 ChangeLog at 闇Webサーバ勉強会#5
Naoya Nakazawa
 
/etc/rc.d配下とかのリーディング勉強会
Naoya Nakazawa
 
fastcgi_conf and mime_types
Naoya Nakazawa
 
mod_security introduction at study2study #3
Naoya Nakazawa
 
httpd.conf line 1 to 7, 24
Naoya Nakazawa
 
puppet @techlifecookpad
Naoya Nakazawa
 
zsh最強シェル入門読書会1
Naoya Nakazawa
 
Velocity Report 2009
Naoya Nakazawa
 
Mac Ports
Naoya Nakazawa
 
Ad

Recently uploaded (20)

PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
PPTX
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
PDF
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
PDF
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PPTX
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
DevBcn - Building 10x Organizations Using Modern Productivity Metrics
Justin Reock
 
MSP360 Backup Scheduling and Retention Best Practices.pptx
MSP360
 
Empower Inclusion Through Accessible Java Applications
Ana-Maria Mihalceanu
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
"Beyond English: Navigating the Challenges of Building a Ukrainian-language R...
Fwdays
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
How Startups Are Growing Faster with App Developers in Australia.pdf
India App Developer
 
The Builder’s Playbook - 2025 State of AI Report.pdf
jeroen339954
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
✨Unleashing Collaboration: Salesforce Channels & Community Power in Patna!✨
SanjeetMishra29
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 

Study2study#4 nginx conf_1_24

Editor's Notes