Documentation du Dr FRAPPE

Ce wiki regroupe les résultats de mes expériences en informatique accumulés au cours de mes recherches sur le net.

Dans la mesure du possible, j'ai cité mes sources ; il en manque certainement… :-)

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

logiciel:internet:nginx:debutant [2018/06/25 07:50]
admin créée
logiciel:internet:nginx:debutant [2018/07/11 11:23] (Version actuelle)
admin
Ligne 27: Ligne 27:
  
 Par défaut, le fichier de configuration est **usr/​local/​nginx/​conf/​nginx.conf**,​ **/​etc/​nginx/​nginx.conf** ou **/​usr/​local/​etc/​nginx/​nginx.conf**. Par défaut, le fichier de configuration est **usr/​local/​nginx/​conf/​nginx.conf**,​ **/​etc/​nginx/​nginx.conf** ou **/​usr/​local/​etc/​nginx/​nginx.conf**.
-===== - Starting, Stopping, and Reloading Configuration ===== 
  
-To start nginxrun the executable file. Once nginx is started, it can be controlled by invoking the executable with the -s parameter. Use the following syntax:+====== - Démarrerarrêter et recharger la configuration ======
  
-    ​nginx -s signal+Pour démarrer ​nginx, exécutez le fichier exécutable.
  
-Where signal ​may be one of the following:+Une fois **nginx** démarré, on le contrôle en invoquant l'​exécutable avec le paramètre -s selon la syntaxe suivante : 
 +<​cli>​$ nginx -s signal</​cli>​ 
 +où le signal peut être l'un des suivants : 
 +  ? stop 
 +  : arrêt rapide 
 +  ? quit 
 +  : arrêt progressif 
 +  ? reload 
 +  : recharger le fichier de configuration 
 +  ? reopen 
 +  ​réouverture des fichiers journaux
  
-    stop — fast shutdown +Par exemple, pour arrêter **nginx** avec attente de la fin des processus en cours, exécutez : 
-    quit — graceful shutdown +<​cli>​$ nginx -s quit</​cli>​
-    reload — reloading the configuration file +
-    reopen — reopening the log files+
  
-For example, to stop nginx processes with waiting for the worker processes to finish serving current requests, the following command can be executed:+Exécutez cette commande sous l'​utilisateur qui a démarré de nginx.
  
-    nginx -quit +Les modifications du fichier de configuration ne s’appliqueront que quand la commande de rechargement de la configuration est envoyée à nginx ou qu'il est redémarré.
- +
-    This command should be executed under the same user that started ​nginx.+
  
 +Pour recharger la configuration,​ exécutez :
 Changes made in the configuration file will not be applied until the command to reload configuration is sent to nginx or it is restarted. To reload configuration,​ execute: Changes made in the configuration file will not be applied until the command to reload configuration is sent to nginx or it is restarted. To reload configuration,​ execute:
- +<​cli>​$ ​nginx -s reload</​cli>​
-    ​nginx -s reload+
  
 Once the master process receives the signal to reload configuration,​ it checks the syntax validity of the new configuration file and tries to apply the configuration provided in it. If this is a success, the master process starts new worker processes and sends messages to old worker processes, requesting them to shut down. Otherwise, the master process rolls back the changes and continues to work with the old configuration. Old worker processes, receiving a command to shut down, stop accepting new connections and continue to service current requests until all such requests are serviced. After that, the old worker processes exit. Once the master process receives the signal to reload configuration,​ it checks the syntax validity of the new configuration file and tries to apply the configuration provided in it. If this is a success, the master process starts new worker processes and sends messages to old worker processes, requesting them to shut down. Otherwise, the master process rolls back the changes and continues to work with the old configuration. Old worker processes, receiving a command to shut down, stop accepting new connections and continue to service current requests until all such requests are serviced. After that, the old worker processes exit.
Ligne 62: Ligne 67:
 For more information on sending signals to nginx, see Controlling nginx. For more information on sending signals to nginx, see Controlling nginx.
  
-===== - Configuration File’s Structure =====+====== - Configuration File’s Structure ​======
  
 nginx consists of modules which are controlled by directives specified in the configuration file. Directives are divided into simple directives and block directives. A simple directive consists of the name and parameters separated by spaces and ends with a semicolon (;). A block directive has the same structure as a simple directive, but instead of the semicolon it ends with a set of additional instructions surrounded by braces ({ and }). If a block directive can have other directives inside braces, it is called a context (examples: events, http, server, and location). nginx consists of modules which are controlled by directives specified in the configuration file. Directives are divided into simple directives and block directives. A simple directive consists of the name and parameters separated by spaces and ends with a semicolon (;). A block directive has the same structure as a simple directive, but instead of the semicolon it ends with a set of additional instructions surrounded by braces ({ and }). If a block directive can have other directives inside braces, it is called a context (examples: events, http, server, and location).
Ligne 70: Ligne 75:
 The rest of a line after the # sign is considered a comment. The rest of a line after the # sign is considered a comment.
  
-===== - Serving Static Content =====+====== - Serving Static Content ​======
  
 An important web server task is serving out files (such as images or static HTML pages). You will implement an example where, depending on the request, files will be served from different local directories:​ /data/www (which may contain HTML files) and /​data/​images (containing images). This will require editing of the configuration file and setting up of a server block inside the http block with two location blocks. An important web server task is serving out files (such as images or static HTML pages). You will implement an example where, depending on the request, files will be served from different local directories:​ /data/www (which may contain HTML files) and /​data/​images (containing images). This will require editing of the configuration file and setting up of a server block inside the http block with two location blocks.
Ligne 121: Ligne 126:
     In case something does not work as expected, you may try to find out the reason in access.log and error.log files in the directory /​usr/​local/​nginx/​logs or /​var/​log/​nginx. ​     In case something does not work as expected, you may try to find out the reason in access.log and error.log files in the directory /​usr/​local/​nginx/​logs or /​var/​log/​nginx. ​
  
-===== - Setting Up a Simple Proxy Server =====+====== - Setting Up a Simple Proxy Server ​======
  
 One of the frequent uses of nginx is setting it up as a proxy server, which means a server that receives requests, passes them to the proxied servers, retrieves responses from them, and sends them to the clients. One of the frequent uses of nginx is setting it up as a proxy server, which means a server that receives requests, passes them to the proxied servers, retrieves responses from them, and sends them to the clients.
Ligne 179: Ligne 184:
 There are many more directives that may be used to further configure a proxy connection. There are many more directives that may be used to further configure a proxy connection.
  
-===== - Setting Up FastCGI Proxying =====+====== - Setting Up FastCGI Proxying ​======
  
 nginx can be used to route requests to FastCGI servers which run applications built with various frameworks and programming languages such as PHP. nginx can be used to route requests to FastCGI servers which run applications built with various frameworks and programming languages such as PHP.
Ligne 198: Ligne 203:
  
 This will set up a server that will route all requests except for requests for static images to the proxied server operating on localhost:​9000 through the FastCGI protocol. ​ This will set up a server that will route all requests except for requests for static images to the proxied server operating on localhost:​9000 through the FastCGI protocol. ​
-===== - Introduction ===== 
  
-===== - Pré-requis =====+====== - Introduction ====== 
 + 
 +====== - Pré-requis ​======
  
-===== - Installation =====+====== - Installation ​======
  
-===== - Configuration =====+====== - Configuration ​======
  
-===== - Utilisation =====+====== - Utilisation ​======
  
-===== - Désinstallation =====+====== - Désinstallation ​======
  
-===== - Voir aussi =====+====== - Voir aussi ======
  
   * **(en)** [[https://​nginx.org/​en/​docs/​beginners_guide.html]]   * **(en)** [[https://​nginx.org/​en/​docs/​beginners_guide.html]]

QR Code
QR Code logiciel:internet:nginx:debutant (generated for current page)