• Contact
  • Politique de confidentialité

Blob

im.inmymind.fr

nginx

Fixer l’erreur HTTP en cas d’upload WordPress avec un serveur Nginx

7 août 2016 by depmod Leave a Comment

Voici comment j’ai pu régler le problème lié à l’envoi des médias sur WordPress.

Dans le fichier  /etc/php/7.0/fpm/php.ini

Shell
1
2
3
4
5
6
max_input_time = 120
memory_limit = 128M
 
// Pour augmenter la taille limite des médias
post_max_size = 8M
upload_max_filesize = 8M

Dans le fichier  /etc/nginx/nginx.conf

Shell
1
client_max_body_size 8m;

Après un redémarrage des services, tout fonctionnait parfaitement!

Posted in: Sysadmin Tagged: nginx, php, wordpress

Ajoutez un filtre fail2ban contre les attaques w00tw00t avec nginx

22 juin 2014 by depmod 1 Comment

Les attaques w00tw00t sur votre serveur peuvent être très gênantes et utilisent des ressources inutilement. Il est pourtant très simple de les bloquer grâce à fail2ban.

Si vous n’avez pas encore fail2ban, empressez vous d’installer ce logiciel fantastique ( apt-get install fail2ban  sous Debian / Ubuntu).

La première étape consiste à créer un filtre pour les logs nginx, commencez donc par créer un fichier /etc/fail2ban/filter.d/nginx-w00tw00t.conf avec le contenu suivant :

Shell
1
2
3
4
[Definition]
failregex = ^<HOST> -.*"GET \/w00tw00t\.at\.ISC\.SANS\.DFind\:\).*".*
 
ignoreregex =

Editez ensuite votre fichier /etc/fail2ban/jail.conf et ajoutez

Shell
1
2
3
4
5
6
7
8
[nginx-w00tw00t]
 
enabled  = true
port     = http
filter   = nginx-w00tw00t
logpath  = /var/log/nginx/access.log
maxretry = 1
bantime  = 172800

Avec ces paramètres, fail2ban va bloquer chaque robot pendant 2 jours.

N’hésitez pas à tester votre configuration à l’aide de la commande fail2ban-regex :  fail2ban-regex /var/log/nginx/access.log /etc/fail2ban/filter.d/nginx-w00tw00t.conf .

Vous pouvez consulter le résultat des bans dans le fichier /var/log/fail2ban.log.

Posted in: Sysadmin Tagged: fail2ban, nginx, w00tw00t

Ajoutez un filtre fail2ban anti DDOS pour Nginx

11 mai 2014 by depmod Leave a Comment

Les attaques DDOS sur votre serveur peuvent être très gênantes et utilisent des ressources inutilement. Il est pourtant très simple de les bloquer grâce à fail2ban.

Si vous n’avez pas encore fail2ban, empressez vous d’installer ce logiciel fantastique ( apt-get install fail2ban  sous Debian / Ubuntu).

La première étape consiste à créer un filtre pour les logs nginx, commencez donc par créer un fichier /etc/fail2ban/filter.d/nginx-dos.conf avec le contenu suivant :

Shell
1
2
3
4
5
6
# fail2ban filter configuration for nginx
 
[Definition]
failregex = ^<HOST> -.*"(GET|POST).*HTTP.*"$
 
ignoreregex =

Editez ensuite votre fichier /etc/fail2ban/jail.conf et ajoutez

Shell
1
2
3
4
5
6
7
8
9
[nginx-dos]
 
enabled  = true
port     = http
filter   = nginx-dos
logpath  = /var/log/nginx/access.log
findtime = 30
bantime  = 172800
maxretry = 120

Avec ces paramètres, fail2ban va bloquer tous les robots qui lancent plus de 120 requêtes par tranche de 30 secondes pendant 2 jours. Par définition, un humain ne peut pas avoir autant de requêtes sur un laps de temps aussi court.

N’hésitez pas à tester votre configuration à l’aide de la commande fail2ban-regex :  fail2ban-regex /var/log/nginx/access.log /etc/fail2ban/filter.d/nginx-dos.conf .

Vous pouvez consulter le résultat des bans dans le fichier /var/log/fail2ban.log.

Posted in: Sysadmin Tagged: ddos, fail2ban, nginx

WordPress URL rewriting with Nginx

20 avril 2014 by depmod Leave a Comment

1
2
3
location /wp/ {
  try_files $uri $uri/ /wp/index.php?$args;
}

 

Posted in: Sysadmin Tagged: nginx, rewriting, wordpress

Recherche

Archives

  • septembre 2022
  • août 2020
  • janvier 2020
  • février 2019
  • février 2018
  • avril 2017
  • février 2017
  • novembre 2016
  • octobre 2016
  • septembre 2016
  • août 2016
  • mars 2016
  • janvier 2016
  • septembre 2014
  • juin 2014
  • mai 2014
  • avril 2014

Tags

alps api apticron aravis comptabilité course ddos DEC diplôme dog fail2ban kernel landscape love marche mineral mrtg nginx ovh photo php plage plaisir PS4 rewriting running snow sunshine ubuntu Uncharted vacances vtt w00tw00t wedding wordpress

Catégories

  • Coding
  • Life
  • Running
  • Sysadmin

Méta

  • Connexion
  • Flux des publications
  • Flux des commentaires
  • Site de WordPress-FR

wö.Ôt

Articles récents

  • Golden hour
  • Minéral
  • Une belle aventure
  • Lovely Aravis
  • #snow #run

Commentaires récents

  • maillotfoot dans Juste un nouveau jouet
  • Filtre Fail2Ban | Duy PHAM dans Ajoutez un filtre fail2ban contre les attaques w00tw00t avec nginx

Archives

  • septembre 2022
  • août 2020
  • janvier 2020
  • février 2019
  • février 2018
  • avril 2017
  • février 2017
  • novembre 2016
  • octobre 2016
  • septembre 2016
  • août 2016
  • mars 2016
  • janvier 2016
  • septembre 2014
  • juin 2014
  • mai 2014
  • avril 2014

Catégories

  • Coding
  • Life
  • Running
  • Sysadmin

Méta

  • Connexion
  • Flux des publications
  • Flux des commentaires
  • Site de WordPress-FR

Copyright © 2023 Blob.

Omega WordPress Theme by ThemeHall

We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept All”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent.
Cookie SettingsAccept All
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Toujours activé
Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
CookieDuréeDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
Functional
Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
Performance
Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
Analytics
Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
Advertisement
Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
Others
Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
Enregistrer & appliquer