apt-cache depends nginx | tail -n+2 | cut -d: -f 2 | sort -u nginx-core nginx-extras nginx-full nginx-light nginx-naxsi
nginx-core is the only flavor in the Main section of the Ubuntu Repositories, as of 14.04, and exists only in the Ubuntu repositories (and is not in the PPAs or Debian, and is not going to be included in Debian ever). It is effectively identical to the nginx-full flavor, but does not contain any third party modules. The reasoning behind using nginx-full as the base for this variant was that we wanted to provide a relatively-full-fledged set of core modules in the built binaries, while keeping third party modules out at the same time. As such, it does not contain any of the third-party modules, since the Security Team did a review of the code and found that third party modules have widely varying coding styles which aren't as nicely supported as the nginx-tarball-included modules (this is discussed more in-depth in the Main Inclusion Request/Report bug, which contains the discussion points and further review discussions as to what could be included in Ubuntu Main for nginx). A full list of the modules enabled here is in the package description, which I've nitpicked here:
STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Browser, Charset, Empty GIF, FastCGI, Geo, Gzip, Headers, Index, Limit Requests, Limit Zone, Log, Map, Memcached, Proxy, Referer, Rewrite, SCGI, Split Clients, SSI, Upstream, User ID, UWSGI.
OPTIONAL HTTP MODULES: Addition, Debug, GeoIP, Gzip Precompression, HTTP Sub, Image Filter, IPv6, Real IP, Spdy, SSL, Stub Status, Substitution, WebDAV, XSLT.
MAIL MODULES: Mail Core, IMAP, POP3, SMTP, SSL.
nginx-light is the lightest flavor of nginx available. It is in the Universe repository and you have to have that enabled to use it. It does not enable a large amount of the modules available in -core or -full. It also contains third-party modules. The modules available in it are as follows:
STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Charset, Empty GIF, FastCGI, Gzip, Headers, Index, Log, Map, Proxy, Rewrite, Upstream.
OPTIONAL HTTP MODULES: Auth Request, Debug, Gzip Precompression, IPv6, Real Ip, SSL, Stub Status.
THIRD PARTY MODULES: Echo.
nginx-full is one of the more feature-rich flavors of the nginx package. Like its light counterpart, it is in the Universe repository. It enables most of the core included modules that are standard and optional in the from-nginx source tarball, as well as several more third-party modules designed to extend the capabilities of the nginx web server. It's modules are as follows:
STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Browser, Charset, Empty GIF, FastCGI, Geo, Gzip, Headers, Index, Limit Requests, Limit Zone, Log, Map, Memcached, Proxy, Referer, Rewrite, SCGI, Split Clients, SSI, Upstream, User ID, UWSGI.
OPTIONAL HTTP MODULES: Addition, Auth Request, Debug, GeoIP, Gzip Precompression, HTTP Sub, Image Filter, IPv6, Real IP, Spdy, SSL, Stub Status, Substitution, WebDAV, XSLT.
MAIL MODULES: Mail Core, IMAP, POP3, SMTP, SSL.
THIRD PARTY MODULES: Auth PAM, DAV Ext, Echo, HTTP Substitution Filter, Upstream Fair Queue.
nginx-extras is the most feature-rich flavor of the nginx package. And like its full and light brothers, it too is in the Universe repository. It enables all of the modules in nginx-full but also includes additional modules (such as the Perl module), and many more third-party modules designed to even further extend the capabilities of the nginx web server. Its full modules list is below:
STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Browser, Charset, Empty GIF, FastCGI, Geo, Gzip, Headers, Index, Limit Requests, Limit Zone, Log, Map, Memcached, Proxy, Referer, Rewrite, SCGI, Split Clients, SSI, Upstream, User ID, UWSGI.
OPTIONAL HTTP MODULES: Addition, Auth Request, Debug, Embedded Perl, FLV, GeoIP, Gzip Precompression, Image Filter, IPv6, MP4, Random Index, Real IP, Secure Link, Spdy, SSL, Stub Status, Substitution, WebDAV, XSLT.
MAIL MODULES: Mail Core, IMAP, POP3, SMTP, SSL.
THIRD PARTY MODULES: Auth PAM, Chunkin, DAV Ext, Echo, Embedded Lua, Fancy Index, HttpHeadersMore, HTTP Substitution Filter, http push, Nginx Development Kit, Upload Progress, Upstream Fair Queue.
nginx-naxsi is the variant of nginx which has the Naxsi Web Application Firewall module available. It too is in Universe, however this flavor is no longer supported by Debian maintainers, and will be completely dropped from Ubuntu with the 15.04 release. In addition to the Naxsi WAF module, it also includes a much lighter set of modules than nginx-full. The full list of modules is below:
STANDARD HTTP MODULES: Core, Access, Auth Basic, Auto Index, Browser, Charset, Core, Empty GIF, FastCGI, Geo, Gzip, Headers, Index, Limit Requests, Limit Zone, Log, Map, Memcached, Proxy, Referer, Rewrite, Split Clients, SSI, Upstream, User ID.
OPTIONAL HTTP MODULES: Debug, IPv6, Real IP, SSL, Stub Status.
THIRD PARTY MODULES: Naxsi, Cache Purge, Upstream Fair.
sudo apt-get update -y sudo apt-get install -y nginx-common sudo apt-get install -y nginx-extras sudo systemctl restart nginx
Install PHP
sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php sudo apt-get update -y sudo apt-get install -y php7.4 sudo apt-get install php-fpm php-mysql
Installing PHP extensions
sudo apt install php7.4 php7.4-common php7.4-opcache php7.4-cli php7.4-gd php7.4-curl php7.4-mysql
sudo ufw allow 80/tcp sudo ufw allow 443/tcp sudo ufw delete allow 'Nginx HTTP' sudo ufw allow 'Nginx Full' sudo ufw status
sudo systemctl disable apache2 sudo systemctl enable nginx
A voir tester
-----------------------------
wget 'http://nginx.org/download/nginx-1.9.3.tar.gz'
tar -xzvf nginx-1.9.3.tar.gz
cd nginx-1.9.3/
# Here we assume you would install you nginx under /opt/nginx/.
./configure --prefix=/opt/nginx \
--add-module=/path/to/headers-more-nginx-module
make
make install
-----------------------------
Pas de modificateur
L'emplacement est interprété comme un préfixe.
Toutes les requêtes dont les URL ont le préfixe défini dans la directive location sont considérées comme correspondant à l'emplacement.
Si aucun autre emplacement spécifique n'est trouvé, la demande est traitée en fonction des informations contenues dans ce bloc d'emplacement
=
L’emplacement est interprété comme une correspondance exacte.
Toutes les requêtes dont l'URL correspond exactement à la chaîne de caractères listée dans la directive location sont traitées conformément aux spécifications de ce bloc de localisation.
~
Le lieu est interprété comme une expression régulière.
Toutes les requêtes dont l'URL correspond à l'expression régulière sont traitées conformément aux spécifications de ce bloc de localisation.
Les majuscules et minuscules sont évaluées pendant le réglage (sensible à la casse).
~*
Le lieu est interprété comme une expression régulière.
Toutes les requêtes dont l'URL correspond à l'expression régulière sont traitées conformément aux spécifications de ce bloc de localisation.
Les majuscules et minuscules ne sont pas évaluées pendant l'ajustement (insensible à la casse).
Concrêtement la présence du fichier maintenance.lock va activer le mode maintenance, sauf si l’IP du client est une IP autorisée. Cela vous permettra de tester votre site alors que les autres internautes auront un accès coupé au site.
Il ne vous reste plus qu’à créer une simple page maintenance.html pour avertir vos visiteurs.
server {
listen 80;
server_name mysite.com;
root /home/project/web;
# etc.
if (-f /home/project/maintenance.lock) {
set $maintenance 1;
}
# Remplacez ici par votre IP locale
if ($remote_addr = "127.0.0.1") {
set $maintenance 0;
}
if ($maintenance = 1) {
return 503;
}
error_page 503 @maintenance;
location @maintenance {
rewrite ^(.*)$ /maintenance.html break;
}
}
https://www.getpagespeed.com/nginx-extras
https://openclassrooms.com/fr/courses/1733551-gerez-votre-serveur-linux-et-ses-services/5236081-mettez-en-place-un-reverse-proxy-avec-nginx
https://askubuntu.com/questions/553937/what-is-the-difference-between-the-core-full-extras-and-light-packages-for-ngi
https://www.grafikart.fr/tutoriels/nginx-692
https://docs.nginx.com/nginx/admin-guide/load-balancer/tcp-udp-load-balancer/
https://help.dreamhost.com/hc/en-us/articles/215840318-Custom-error-pages
https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-reverse-proxy-for-apache
https://www.ionos.fr/digitalguide/serveur/configuration/tutoriel-nginx-premiers-pas-avec-nginxconf/
https://www.nginx.com/resources/wiki/modules/upload/
https://www.ionos.fr/digitalguide/serveur/know-how/nginx-vs-apache/
https://linuxize.com/post/nginx-reverse-proxy/
https://www.scaleway.com/en/docs/how-to-configure-nginx-reverse-proxy/
https://medium.com/@shevtsovav/ready-for-scraping-nginx-metrics-nginx-vts-exporter-prometheus-grafana-26c14816ae7c
https://wiki.evolix.org/HowtoNginx
https://www.it-connect.fr/debian-comment-installer-nginx-en-tant-que-serveur-web/
https://rdr-it.com/nginx-configuration-reverse-proxy/
Recompile :
https://www.nginx.com/blog/compiling-dynamic-modules-nginx-plus/
https://gorails.com/blog/how-to-compile-dynamic-nginx-modules
https://subscription.packtpub.com/book/networking_and_servers/9781849514965/1/ch01lvl1sec09/installing-new-modules-and-compiling-nginx
Configuration :
https://www.digitalocean.com/community/tools/nginx
Mode de maintenance :
https://stackoverflow.com/questions/69476583/how-to-force-nginx-to-use-backup-upstream-and-vice-versa