informatique:nginx
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes | ||
informatique:nginx [14/01/2017 15:19] – [CGI] ngx_http_fastcgi_module cyrille | informatique:nginx [06/05/2023 23:50] – [WAF (Web Application Firewall)] cyrille | ||
---|---|---|---|
Ligne 21: | Ligne 21: | ||
* [[http:// | * [[http:// | ||
* [[http:// | * [[http:// | ||
+ | |||
+ | ===== Securité ===== | ||
+ | |||
+ | ==== WAF (Web Application Firewall) ==== | ||
+ | |||
+ | * ModSecurity | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * NAXSI (Nginx Anti Xss & Sql Injection) | ||
+ | * https:// | ||
+ | * https:// | ||
+ | * [[https:// | ||
+ | |||
+ | ==== Autre ==== | ||
+ | |||
+ | * Bunkerized Nginx | ||
+ | * https:// | ||
+ | * [[https:// | ||
+ | |||
===== Tips & Tricks ===== | ===== Tips & Tricks ===== | ||
+ | |||
+ | ==== Letsencrypt certbot reload ==== | ||
+ | |||
+ | '' | ||
+ | |||
+ | ''/ | ||
+ | <code bash> | ||
+ | #!/bin/sh | ||
+ | # set -e | ||
+ | systemctl reload nginx | ||
+ | </ | ||
+ | |||
+ | ==== Optimize Nginx ==== | ||
[[https:// | [[https:// | ||
+ | |||
+ | ==== Logging ==== | ||
+ | |||
+ | * [[https:// | ||
+ | |||
+ | ==== more than one worker process ==== | ||
http:// | http:// | ||
Ligne 54: | Ligne 92: | ||
Keep it an on unless you know why you need to turn it off. | Keep it an on unless you know why you need to turn it off. | ||
+ | |||
+ | ==== nginx proxy cache tuiles OSM ==== | ||
+ | |||
+ | configuration nginx pour installer un cache de tuiles OSM par CQuest : https:// | ||
+ | |||
+ | < | ||
+ | # tilecache.conf | ||
+ | # conserver les tuiles dans /var/cache, pendant 24h et au maximum 16Go | ||
+ | proxy_cache_path / | ||
+ | |||
+ | server { | ||
+ | server_name tilecache.mondomaine.tld a.tilecache.mondomaine.tld b.tilecache.mondomaine.tld c.tilecache.mondomaine.tld; | ||
+ | listen 80; | ||
+ | | ||
+ | location / { | ||
+ | proxy_pass http:// | ||
+ | proxy_cache tilecache; | ||
+ | proxy_cache_valid | ||
+ | proxy_cache_valid | ||
+ | proxy_cache_lock on; | ||
+ | |||
+ | # on ajoute l'IP du client dans la requête vers le upstream | ||
+ | proxy_set_header X-Forwarded-For $remote_addr; | ||
+ | |||
+ | # on indique le status du cache dans la réponse au client | ||
+ | add_header X-Cache-Status $upstream_cache_status; | ||
+ | # si upstream down, on envoie la copie qu'on a en cache | ||
+ | proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
informatique/nginx.txt · Dernière modification : 21/09/2023 11:47 de cyrille