SlideShare a Scribd company logo
1 of 31
Download to read offline
NGINX
THE WEB SERVER YOU MIGHT ACTUALLY LIKE
ABOUT ME
PHP since 10 years
CI
CleanCode
DevOps
TDD
Shipping
GET IN TOUCH

stackoverflow:
Twitter: @__edorian
Xing / G+: Volker Dusch
IRC: edorian
Mail: php@wallbash.com
LET'S GO
WHY ANOTHER WEBSERVER?
WHY NOT LIGHTTPD?
THE BASICS
Intro
Multiple Servers / Domains
Static content
SSL
Error pages
Rewrites
Auth
Caching
Load Balancing
Proxy
PHP!
INTRO
/t/gn/gn.of
 ecnixnixcn
/t/gn/ofd*cn
 ecnixcn./.of
NGINX CONF BASICS
ue nix
 sr gn;
wre_rcse 6
 okrpoess ;
wre_p_fiiy000 001 000 010 000 100;
 okrcuafnt 001 000 010 000 100 000

errlg /a/o/gn/ro.o wr;
 ro_o  vrlgnixerrlg an
pd
 i    /a/u/gn.i;
       vrrnnixpd

eet {
 vns
  wre_oncin
   okrcnetos 12;
              04
}
NGINX CONF BASICS
ht {
 tp
   icue
    nld    /t/gn/ietps
            ecnixmm.ye;
   dfuttp apiainottsra;
    eal_ye plcto/ce-tem

    acs_o /a/o/gn/ceslg mi;
     ceslg vrlgnixacs.o an
    snfl
     edie    o;
              n
    keaietmot 6;
     eplv_ieu   5

    icue/t/gn/ofd*cn;
     nld ecnixcn./.of
}
SERVERS
sre {
 evr
  sre_ae*wlbs.o *wlbs.e
   evrnm .alahcm .alahd;
  lse 8;
   itn 0
  / ..
   / .
}

sre {
 evr
  sre_ae_
   evrnm ;
  lse 8;
   itn 0
  / ..
   / .
}
STATIC CONTENT
lcto /{
 oain
  ro /a/w/yp/tl
   ot vrwwmAphm/
}
FANCY STATIC CONTENT
lcto ~^/j|m|s){
 oain  (sigcs
}
DENY ACCESS TO ALL .DOT-FILES
lcto ~/.{
 oain  
  acs_o of
   ceslg f;
  lgntfudof
   o_o_on f;
  dn al
   ey l;
}
SSL
slcriiae
 s_etfct     wlcr.r;
             idadct
slcriiaeky
 s_etfct_e   wlcr.e;
             idadky

slssintmot 5;
 s_eso_ieu  m
slssinccesae:S:0;
 s_eso_ah hrdSL1m

slpooosSL3TS1TS11TS12
 s_rtcl Sv Lv  Lv. Lv.;
slpee_evrcpeso;
 s_rfrsre_ihr  n
slcpesEDERAAS5-H34AS5-H26R4HG:M5!NL:EH!E
 s_ihr CH-S-E26SA8:E26SA5:C:IH!D:aUL!D:A
SC;
 GM
sled_uv sc511
 s_chcre ep2r;
ERROR PAGES
errpg 5051525354/0.tl
 ro_ae 0 0 0 0 0 50hm;

lcto /0.tl{
 oain 50hm
  itra;
   nenl
}

lcto /0 {
 oain 50
  rtr 50
   eun 0;
}
REWRITES
sre {
 evr
  sre_ae ht:/;
   evrnm   tp/*
  lse
   itn    8;
           0
  rwie^hts/$otrqetuipraet
   ert   tp:/hs$eus_r emnn;
}
CACHING
lcto ~^/j|m|s){
 oain  (sigcs
  eprs1d
   xie 4;
}
AUTH
lcto /{
 oain
  at_ai "etitd;
   uhbsc Rsrce"
  at_ai_srfl /t/gn/ofdmAphpsw;
   uhbscue_ie ecnixcn./yp.tasd
}
LOAD BALANCING
usra wbwres{
 ptem e_okr
  sre ww.xml.o;
   evr w1eapecm
  sre ww.xml.o;
   evr w2eapecm
  sre ww.xml.o;
   evr w3eapecm
  sre ww.xml.o;
   evr w4eapecm
}
LOAD BALANCING LEGACY
usra wbwres{
 ptem e_okr
  i_ah
   phs;
  sre ww.xml.o;
   evr w1eapecm
  sre ww.xml.o;
   evr w2eapecm
  sre ww.xml.o;
   evr w3eapecm
  sre ww.xml.o;
   evr w4eapecm
}
PROXY
lcto /{
 oain
  poyps
   rx_as    ht:/oahs:00
            tp/lclot80;
  poysthae
   rx_e_edr XRa-P $eoead;
            -elI   rmt_dr
  poycce
   rx_ah    zn;
            oe
}
PHP!
PHP-FPM!?!
FastCGI Process Manager
FPM-CONFIG
[yp]
 mAp

lse =90
 itn 00

;itnalwdcins=17001
 lse.loe_let  2...

ue =pp
 sr  h
gop=pp
 ru   h

p =dnmc
 m  yai
p.a_hlrn=5
 mmxcide  0
p.tr_evr =5
 msatsres
p.i_pr_evr =5
 mmnsaesres
p.a_pr_evr =3
 mmxsaesres  5

solg=/a/o/h-p/yp-lwlg
 lwo  vrlgppfmmApso.o
NGINX + PHP
lcto /{
 oain
  fscips
   atg_as 1700.:00
          2..1190;
  fsciprm SRP_IEAE /a/w/yp/tlidxpp
   atg_aa CITFLNM   vrwwmAphm/ne.h;
  icue
   nld    fsciprm;
          atg_aas
}
SCALING!
lcto /{
 oain
  fscips
   atg_as aoteSre:00
          nnhrevr90;
  fsciprm SRP_IEAE /a/w/yp/tlidxpp
   atg_aa CITFLNM   vrwwmAphm/ne.h;
  icue
   nld    fsciprm;
          atg_aas
}
THANKS HELGI!
@h
http://helgi.ws/
Further reading:
https://speakerdeck.com/u/helgi/p/cranking-nginx-to-11-phptek-
2012
THANK YOU
Nginx   The webserver you might actually like

More Related Content

Viewers also liked

презентация1
презентация1презентация1
презентация1yolkina548
 
компьютерная мышь
компьютерная мышькомпьютерная мышь
компьютерная мышьyolkina548
 
So Update January 2007
So Update January 2007So Update January 2007
So Update January 2007GryKB
 
2118 Final With Bg 2
2118 Final With Bg 22118 Final With Bg 2
2118 Final With Bg 22118tibet
 
National Geographic2
National Geographic2National Geographic2
National Geographic2guest707d8f1
 
Energy Overview No Video Small
Energy Overview No Video   SmallEnergy Overview No Video   Small
Energy Overview No Video SmallChris_Moore
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principlesEdorian
 
компьютерная мышь
компьютерная мышькомпьютерная мышь
компьютерная мышьyolkina548
 
Expotacuaral09
Expotacuaral09Expotacuaral09
Expotacuaral09TACUARAL
 
The Good/Bad of Power Point
The Good/Bad of Power PointThe Good/Bad of Power Point
The Good/Bad of Power PointGregg Martinson
 
Regulations, Acts, and everything else you need to know about payroll legisla...
Regulations, Acts, and everything else you need to know about payroll legisla...Regulations, Acts, and everything else you need to know about payroll legisla...
Regulations, Acts, and everything else you need to know about payroll legisla...Softworld
 
компьютерная мышь
компьютерная мышькомпьютерная мышь
компьютерная мышьyolkina548
 

Viewers also liked (20)

Alex j
Alex jAlex j
Alex j
 
презентация1
презентация1презентация1
презентация1
 
компьютерная мышь
компьютерная мышькомпьютерная мышь
компьютерная мышь
 
So Update January 2007
So Update January 2007So Update January 2007
So Update January 2007
 
2118 Final With Bg 2
2118 Final With Bg 22118 Final With Bg 2
2118 Final With Bg 2
 
National Geographic2
National Geographic2National Geographic2
National Geographic2
 
MANO
MANOMANO
MANO
 
MANO
MANOMANO
MANO
 
Energy Overview No Video Small
Energy Overview No Video   SmallEnergy Overview No Video   Small
Energy Overview No Video Small
 
Katie. c
Katie. cKatie. c
Katie. c
 
Blake t
Blake tBlake t
Blake t
 
Save time by applying clean code principles
Save time by applying clean code principlesSave time by applying clean code principles
Save time by applying clean code principles
 
Chase A
Chase AChase A
Chase A
 
компьютерная мышь
компьютерная мышькомпьютерная мышь
компьютерная мышь
 
3
33
3
 
Expotacuaral09
Expotacuaral09Expotacuaral09
Expotacuaral09
 
The Good/Bad of Power Point
The Good/Bad of Power PointThe Good/Bad of Power Point
The Good/Bad of Power Point
 
Dolby1
Dolby1Dolby1
Dolby1
 
Regulations, Acts, and everything else you need to know about payroll legisla...
Regulations, Acts, and everything else you need to know about payroll legisla...Regulations, Acts, and everything else you need to know about payroll legisla...
Regulations, Acts, and everything else you need to know about payroll legisla...
 
компьютерная мышь
компьютерная мышькомпьютерная мышь
компьютерная мышь
 

More from Edorian

Your (coding) standards matter
Your (coding) standards matterYour (coding) standards matter
Your (coding) standards matterEdorian
 
Nginx - The webserver you might actually like
Nginx - The webserver you might actually likeNginx - The webserver you might actually like
Nginx - The webserver you might actually likeEdorian
 
From dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneFrom dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneEdorian
 
Code review in practice
Code review in practiceCode review in practice
Code review in practiceEdorian
 
PhpUnit Best Practices
PhpUnit Best PracticesPhpUnit Best Practices
PhpUnit Best PracticesEdorian
 
The state of PHPUnit
The state of PHPUnitThe state of PHPUnit
The state of PHPUnitEdorian
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnitEdorian
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnitEdorian
 
Stop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principlesStop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principlesEdorian
 
php unconference Europa: Clean code - Stop wasting my time
php unconference Europa: Clean code - Stop wasting my timephp unconference Europa: Clean code - Stop wasting my time
php unconference Europa: Clean code - Stop wasting my timeEdorian
 
Clean Code: Stop wasting my time
Clean Code: Stop wasting my timeClean Code: Stop wasting my time
Clean Code: Stop wasting my timeEdorian
 

More from Edorian (11)

Your (coding) standards matter
Your (coding) standards matterYour (coding) standards matter
Your (coding) standards matter
 
Nginx - The webserver you might actually like
Nginx - The webserver you might actually likeNginx - The webserver you might actually like
Nginx - The webserver you might actually like
 
From dev to ops and beyond - getting it done
From dev to ops and beyond - getting it doneFrom dev to ops and beyond - getting it done
From dev to ops and beyond - getting it done
 
Code review in practice
Code review in practiceCode review in practice
Code review in practice
 
PhpUnit Best Practices
PhpUnit Best PracticesPhpUnit Best Practices
PhpUnit Best Practices
 
The state of PHPUnit
The state of PHPUnitThe state of PHPUnit
The state of PHPUnit
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
 
The State of PHPUnit
The State of PHPUnitThe State of PHPUnit
The State of PHPUnit
 
Stop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principlesStop wasting-time-by-applying-clean-code-principles
Stop wasting-time-by-applying-clean-code-principles
 
php unconference Europa: Clean code - Stop wasting my time
php unconference Europa: Clean code - Stop wasting my timephp unconference Europa: Clean code - Stop wasting my time
php unconference Europa: Clean code - Stop wasting my time
 
Clean Code: Stop wasting my time
Clean Code: Stop wasting my timeClean Code: Stop wasting my time
Clean Code: Stop wasting my time
 

Recently uploaded

Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmibookbahareshariat
 
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmibookbahareshariat
 
محاضرات الاحصاء التطبيقي لطلاب علوم الرياضة.pdf
محاضرات الاحصاء التطبيقي لطلاب علوم الرياضة.pdfمحاضرات الاحصاء التطبيقي لطلاب علوم الرياضة.pdf
محاضرات الاحصاء التطبيقي لطلاب علوم الرياضة.pdfKhaled Elbattawy
 
Saunanaine_Helen Moppel_JUHENDATUD SAUNATEENUSE JA LOODUSMATKA SÜNERGIA_strat...
Saunanaine_Helen Moppel_JUHENDATUD SAUNATEENUSE JA LOODUSMATKA SÜNERGIA_strat...Saunanaine_Helen Moppel_JUHENDATUD SAUNATEENUSE JA LOODUSMATKA SÜNERGIA_strat...
Saunanaine_Helen Moppel_JUHENDATUD SAUNATEENUSE JA LOODUSMATKA SÜNERGIA_strat...Eesti Loodusturism
 
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaranFAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaransekolah233
 
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmibookbahareshariat
 
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmibookbahareshariat
 

Recently uploaded (9)

Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 4 By SadurshSharia Mufti Amjad Ali Azmi
 
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 1 By SadurshSharia Mufti Amjad Ali Azmi
 
محاضرات الاحصاء التطبيقي لطلاب علوم الرياضة.pdf
محاضرات الاحصاء التطبيقي لطلاب علوم الرياضة.pdfمحاضرات الاحصاء التطبيقي لطلاب علوم الرياضة.pdf
محاضرات الاحصاء التطبيقي لطلاب علوم الرياضة.pdf
 
Energy drink .
Energy drink                           .Energy drink                           .
Energy drink .
 
Saunanaine_Helen Moppel_JUHENDATUD SAUNATEENUSE JA LOODUSMATKA SÜNERGIA_strat...
Saunanaine_Helen Moppel_JUHENDATUD SAUNATEENUSE JA LOODUSMATKA SÜNERGIA_strat...Saunanaine_Helen Moppel_JUHENDATUD SAUNATEENUSE JA LOODUSMATKA SÜNERGIA_strat...
Saunanaine_Helen Moppel_JUHENDATUD SAUNATEENUSE JA LOODUSMATKA SÜNERGIA_strat...
 
LAR MARIA MÃE DE ÁFRICA .
LAR MARIA MÃE DE ÁFRICA                 .LAR MARIA MÃE DE ÁFRICA                 .
LAR MARIA MÃE DE ÁFRICA .
 
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaranFAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
FAIL REKOD PENGAJARAN.pptx fail rekod pengajaran
 
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 3 By SadurshSharia Mufti Amjad Ali Azmi
 
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali AzmiBahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
Bahare Shariat Jild 2 By SadurshSharia Mufti Amjad Ali Azmi
 

Nginx The webserver you might actually like