Nginx command

  • nginx -s reopen restart nginx
  • nginx -s reload  Reload nginx file
  • nginx -s stop  stop it nginx service
  • nginx -s quit After processing the request , stop it nginx service
  • nginx -q Masking non error messages during profile detection

Nginx To configure


  • Global block , From profile to events Content between blocks , Set up some influences nginx Configuration instructions for the server to run as a whole , Mainly including configuration and operation nginx Users of the server 、 Allowed to produce worker-process Count 、 process PID Storage path 、 Log storage path and type, as well as the introduction of configuration files .
  • events, The instructions involved mainly affect Nginx Network connection between server and user , Inclusion is enough to open to many work process The network connection under is serialized , Whether multiple network connections are allowed to be received simultaneously , Choose which event driven model to handle connection requests , Every worker process The maximum number of connections that can be supported simultaneously
  • http, Proxy cache 、 Most of the functions such as log definition and third-party modules

Reverse proxy

  • server-name Configure name based virtual hosts
  • gzip Whether to turn on compressed transmission
  • location Instructions for matching url
  • proxy-pass Used to set the address of the proxy server
  • proxy-set-header It is used to set the... Received by the proxy server header Information

Load balancing

  • polling according to nginx The order in the configuration file , Turn the client's web Requests are distributed to different back-end services
  • weight According to the weight
  • ip-hash The same client is continuous web Requests may be distributed to different back-end servers for processing , If it comes to conversation session, It's more complicated , Database based session persistence ,ip-hash This problem can be avoided
  • fair Allocate requests based on response time , Priority allocation with short response time
  • url-hash Make every one url Directed to the same back-end server , It is more effective when the backend server is cache

max-fails: Number of requests allowed to fail , The default is 1, When the maximum number of times is exceeded , return proxy-next-upstream Module definition error

fail-timeout:max-fails After failure , Time to pause

nginx Basic knowledge of ( 3、 ... and ) More articles about

  1. java Basic knowledge 3 java Variable

    java  Basic knowledge of 3、 ... and Variable 1. Scope {} Surrounded by code Call it a code block , Variables declared in a block can only be used in a block 2. Constant It's a fixed quantity , Once defined , Its value can no longer be changed . 3. Variable Variables must be in the program ...

  2. Nginx——1. Basic knowledge of

    Nginx——1. Basic knowledge of As a highway . Light weight . High performance and other advantages of a server ,Nginx In recent years, it has been developing rapidly and expanding its market share , Even recently, its market share has surpassed Microsoft's IIS, Jump to second , Second only to Apache. but ...

  3. Python Basic knowledge of ( 3、 ... and )

    Python Basic knowledge of ( 3、 ... and ) 1. Integer # The way to convert binary to decimal # 128 64 32 16 8 4 2 1 1 1 1 1 1 1 For example, digital 5 : 101 # The way to convert decimal to binary Recursively divide the remainder , from ...

  4. C# Basic knowledge of ( 3、 ... and ). Main sub dialog value transfer

    stay C# winform Programming , We often encounter the problem of transferring values between different windows . Such as the application of database , Fill in the main window num1, Click button , In the pop-up sub window, the corresponding num1 value ; Or fill in the new registered user name information in the sub window , In the main window ...

  5. Fast grasp JavaScript Interview Basics ( 3、 ... and )

    Translator press :  Summed up a lot of JavaScript Basic knowledge , It is useful to ! original text : The Definitive JavaScript Handbook for your next developer interv ...

  6. Dapper Basic knowledge 3

    I just graduated from work , Before the internship useful to Dapper? These days, new projects want to use Dapper, I'm a rookie , This is just a personal right Dapper A summary of . Dapper, When the project is developing , When there is no need to use dependency injection , How to do ...

  7. Java Basic knowledge of three

    One .Java Collections framework The collection framework is a unified framework for representing and manipulating collections . All collection frameworks contain the following : Interface : Is an abstract data type that represents a collection . Interfaces allow collections to independently manipulate the details they represent . In object-oriented languages , Interfaces usually form a ...

  8. 3. K Line basic knowledge 3

    1. Yin line In the stock market, the opening price is higher than the closing price K Line ,K Line drawings are usually marked in light blue , It means that the stock price has fallen , When the closing price is below the opening price , That is, when the stock price shows a downward trend , We call this form of K The line is the Yin line . The middle part is blue , here , On the screen ...

  9. Tax Basics > Three taxes ( Sales Tax , The VAT , Income tax ) + tariffs

    Three taxes : Sales Tax The VAT Income tax Main concern : General taxpayers , The threshold is not described in detail . Sales Tax (Business tax) Sales Tax (Business tax), It's about providing taxable services in China . Transfer of intangible assets or sale of ...

  10. python Basic knowledge 3

    In considering their operations , Be sure to think of python Is an object-oriented language , It's not so strict with type , Because in a fully object-oriented language , Everything is an object . So let's start over consider + -  *  / Wait for the operation , No longer stick to the traditional number ...

Random recommendation

  1. js in Window Objects and their methods

    window.location object window.location Object to get the address of the current page (URL), And redirect the browser to a new page .window.location Object can be written without wind ...

  2. 【 turn 】webGL And OpenGL Different

    Original link WebGL and OpenGL Differences     ...

  3. [unity3d plug-in unit ]2dtoolkit A series of Create elves

    I'm going to make one from today on 2d game , Because I used to do cocos2dx Of , And then I got in touch with unity3d, All is done. 3D Aspect stuff , Know what to do 2d The game is still a little fun , Maybe because I don't want to lose the previous 2d Some ideas of the game , And then ...

  4. mongodb Preliminary use

    Download and install : download MongoDB: install MongoDB: Fool installation To configure : hold bin Directories adding to system environment variables start-up : Open one cmd Edit box , Input : mon ...

  5. Mac Python Path summary

    Mac Next Python Multiple versions can coexist , also Python There are also several , But overall ,Mac I have python It's more convenient Mac The system comes with Python , Probably Python Version needs to be updated ...

  6. Matlab With MEX Way to call C Source code

    #include "mex.h" // Use MEX The header file that the file must contain // To carry out specific work C function double add(double x, double y) { return ...

  7. Print Article HDU - 3507 - Slope optimization DP

    Ideas : 1, Using a monotone queue to maintain the solution set . 2, Suppose there are elements in the queue from beginning to end a b c. So when d When it comes to joining the team , We maintain the convexity of the queue , That is, if g[d,c]<g[c,b], Then we will c Point deletion . Until I find ...

  8. java Learning notes 17(Calendarl class )

    Calendar class :( The calendar ) usage :Calendar Is an abstract class : Can't instantiate ( You can't new), When using, it is implemented through subclasses , But this class doesn't need to create subclass objects , It's a static way to get : Get object method :getIns ...

  9. centos7 SSH The link doesn't go up

    I tried the following method, but it didn't work --( And also checked ssh It's installed correctly ) [ One ] close selinuxvi /etc/selinux/config then reboot restart !!!! [ Two ] Turn off the firewall and disable starting , I have the ability to do it myself ...

  10. UOJ #164 【 Tsinghua training 2015】 V

    Topic link :V This is a single point question , So it's very easy to write . Note that each modification can be marked with a tag \((a,b)\) Express . Mark \((a,b)\) Is that \(x= \max\{x+a,b\}\) At the same time, this mark is also ...