Erreur32 revisó este gist 2 years ago. Ir a la revisión
1 file changed, 25 insertions
nginx_htpassword_location.conf(archivo creado)
| @@ -0,0 +1,25 @@ | |||
| 1 | + | location / { | |
| 2 | + | ||
| 3 | + | satisfy any; | |
| 4 | + | # Liste des IPs autorisées | |
| 5 | + | allow 192.168.1.0/24; | |
| 6 | + | # deny all; # Toutes les autres IPs sont refusées sans l’authentification | |
| 7 | + | ||
| 8 | + | # Authentification basique | |
| 9 | + | auth_basic "Restricted Content"; | |
| 10 | + | auth_basic_user_file /data/nginx/.htpasswd; | |
| 11 | + | ||
| 12 | + | proxy_pass http://192.168.1.150:19999/; | |
| 13 | + | ||
| 14 | + | proxy_set_header X-Forwarded-Host $host; | |
| 15 | + | proxy_set_header X-Forwarded-Server $host; | |
| 16 | + | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| 17 | + | ||
| 18 | + | proxy_pass_request_headers on; | |
| 19 | + | proxy_set_header Connection "keep-alive"; | |
| 20 | + | proxy_store off; | |
| 21 | + | ||
| 22 | + | gzip on; | |
| 23 | + | gzip_proxied any; | |
| 24 | + | gzip_types *; | |
| 25 | + | } | |
Siguiente
Anterior