Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| web:authentification [2022/02/24 17:59] – créée michel | web:authentification [2022/03/09 14:23] (Version actuelle) – michel | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== HTTP Authentification ====== | ====== HTTP Authentification ====== | ||
| + | Il faut commencer par créer des utilisateur, | ||
| + | Afin d' | ||
| + | < | ||
| + | sudo apt install apache2-utils | ||
| + | sudo htpasswd -c / | ||
| + | </ | ||
| + | Puis on configure nginx en editant le fichier // | ||
| + | <file conf monsite> | ||
| + | server { | ||
| + | listen 80; | ||
| + | listen [::]:80; | ||
| + | root / | ||
| + | index index.php index.html index.htm | ||
| + | server_name monsite.com; | ||
| + | location / { | ||
| + | try_files $uri $uri/ =404; | ||
| + | auth_basic " | ||
| + | auth_basic_user_file / | ||
| + | } | ||
| + | location ~ \.php$ { | ||
| + | include snippets/ | ||
| + | fastcgi_pass unix:/ | ||
| + | } | ||
| + | } | ||
| + | </ | ||
| + | Et comme pour virtualhost il faut recharger la configuration de NGINX | ||
| + | |||
| + | |||
| + | {{counter}} | ||