Advertisement
Sergio_Istea

balanceo de cargas

Jun 10th, 2024 (edited)
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. upstream backend-servers {
  2. # Por defecto el algoritmo de balanceo es roud robin
  3. # descomentar (solo uno) para activar
  4. # least_conn;
  5. # ip_hash;
  6.  
  7. # pueden ser nombres de host o dominio
  8. # si el servidor proxy puede resolver.
  9. # server backend1.example.com;
  10. # server backend2.example.com;
  11.  
  12. server 1.2.3.4;
  13. server 5.6.7.8;
  14. }
  15.  
  16.  
  17. server {
  18. listen 80;
  19.  
  20. server_name tu-dominio.com;
  21.  
  22. location / {
  23. proxy_pass http://backend-servers;
  24. proxy_set_header Host $host;
  25. proxy_set_header X-Real-IP $remote_addr;
  26. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  27. proxy_set_header X-Forwarded-Proto $scheme;
  28. }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement