début de relecture
This commit is contained in:
parent
3490925cf9
commit
ea2219ba6d
|
@ -4,21 +4,74 @@ title: Howto Nginx
|
||||||
...
|
...
|
||||||
|
|
||||||
* Documentation : <https://nginx.org/en/docs/>
|
* Documentation : <https://nginx.org/en/docs/>
|
||||||
|
* Rôle Ansible : <https://forge.evolix.org/projects/ansible-roles/repository/show/nginx>
|
||||||
|
|
||||||
[Nginx](https://nginx.org/) est un serveur [HTTP](HowtoHTTP) léger et puissant.
|
[Nginx](https://nginx.org/) est un serveur [HTTP](HowtoHTTP) léger, le deuxième plus utilisé sur le web derrière [Apache](HowtoApache).
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
|
Nous utilisons les paquets Debian officiels (version 1.10.3 sous Stretch et Jessie-Backports, version 1.6.2 sous Jessie) :
|
||||||
|
|
||||||
~~~
|
~~~
|
||||||
# apt install nginx
|
# apt install nginx-full
|
||||||
|
|
||||||
|
$ /usr/sbin/nginx -v
|
||||||
|
nginx version: nginx/1.10.3
|
||||||
|
|
||||||
|
systemctl status nginx
|
||||||
|
● nginx.service - A high performance web server and a reverse proxy server
|
||||||
|
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
|
||||||
|
Docs: man:nginx(8)
|
||||||
|
Process: 6881 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
|
||||||
|
Process: 6878 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
|
||||||
|
Main PID: 6882 (nginx)
|
||||||
|
Tasks: 5 (limit: 4915)
|
||||||
|
CGroup: /system.slice/nginx.service
|
||||||
|
├─6882 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
|
||||||
|
├─6883 nginx: worker process
|
||||||
|
├─6884 nginx: worker process
|
||||||
|
├─6885 nginx: worker process
|
||||||
|
└─6886 nginx: worker process
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
Sous Debian Stretch, c'est la version 1.10.3 qui est présente dans les dépôts (1.6.2 pour Debian Jessie).
|
|
||||||
|
|
||||||
## Configuration de base
|
## Configuration de base
|
||||||
|
|
||||||
Fichiers de configuration :
|
Fichiers de configuration :
|
||||||
|
|
||||||
|
~~~
|
||||||
|
/etc/nginx/
|
||||||
|
├── conf.d
|
||||||
|
├── fastcgi.conf
|
||||||
|
├── fastcgi_params
|
||||||
|
├── koi-utf
|
||||||
|
├── koi-win
|
||||||
|
├── mime.types
|
||||||
|
├── modules-available
|
||||||
|
├── modules-enabled
|
||||||
|
│ ├── 50-mod-http-auth-pam.conf -> /usr/share/nginx/modules-available/mod-http-auth-pam.conf
|
||||||
|
│ ├── 50-mod-http-dav-ext.conf -> /usr/share/nginx/modules-available/mod-http-dav-ext.conf
|
||||||
|
│ ├── 50-mod-http-echo.conf -> /usr/share/nginx/modules-available/mod-http-echo.conf
|
||||||
|
│ ├── 50-mod-http-geoip.conf -> /usr/share/nginx/modules-available/mod-http-geoip.conf
|
||||||
|
│ ├── 50-mod-http-image-filter.conf -> /usr/share/nginx/modules-available/mod-http-image-filter.conf
|
||||||
|
│ ├── 50-mod-http-subs-filter.conf -> /usr/share/nginx/modules-available/mod-http-subs-filter.conf
|
||||||
|
│ ├── 50-mod-http-upstream-fair.conf -> /usr/share/nginx/modules-available/mod-http-upstream-fair.conf
|
||||||
|
│ ├── 50-mod-http-xslt-filter.conf -> /usr/share/nginx/modules-available/mod-http-xslt-filter.conf
|
||||||
|
│ ├── 50-mod-mail.conf -> /usr/share/nginx/modules-available/mod-mail.conf
|
||||||
|
│ └── 50-mod-stream.conf -> /usr/share/nginx/modules-available/mod-stream.conf
|
||||||
|
├── nginx.conf
|
||||||
|
├── proxy_params
|
||||||
|
├── scgi_params
|
||||||
|
├── sites-available
|
||||||
|
│ └── default
|
||||||
|
├── sites-enabled
|
||||||
|
│ └── default -> /etc/nginx/sites-available/default
|
||||||
|
├── snippets
|
||||||
|
│ ├── fastcgi-php.conf
|
||||||
|
│ └── snakeoil.conf
|
||||||
|
├── uwsgi_params
|
||||||
|
└── win-utf
|
||||||
|
|
||||||
/etc/nginx/
|
/etc/nginx/
|
||||||
├── conf.d
|
├── conf.d
|
||||||
├── fastcgi.conf
|
├── fastcgi.conf
|
||||||
|
@ -38,7 +91,7 @@ Fichiers de configuration :
|
||||||
│ └── snakeoil.conf
|
│ └── snakeoil.conf
|
||||||
├── uwsgi_params
|
├── uwsgi_params
|
||||||
└── win-utf
|
└── win-utf
|
||||||
|
~~~
|
||||||
|
|
||||||
La configuration principale se fait dans le fichier `/etc/nginx/nginx.conf` :
|
La configuration principale se fait dans le fichier `/etc/nginx/nginx.conf` :
|
||||||
|
|
||||||
|
@ -398,4 +451,10 @@ more_set_headers 'Server: My Server v42'
|
||||||
|
|
||||||
### Configuration en ligne
|
### Configuration en ligne
|
||||||
|
|
||||||
<https://nginxconfig.io/>
|
<https://nginxconfig.io/>
|
||||||
|
|
||||||
|
## FAQ
|
||||||
|
|
||||||
|
### Comment prononcer Nginx ?
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue