Advertisement
aldikhan13

nginx load balancer config

Feb 14th, 2021
1,683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.88 KB | None | 0 0
  1. worker_processes 4;
  2. thread_pool default threads=50 max_queue=100000;
  3.  
  4. events {
  5.   worker_connections 1024;
  6. }
  7.  
  8. http {
  9.  
  10.   upstream webapp-service.io {
  11.     server companies-service:3000 weight=10 max_fails=3 fail_timeout=30s;
  12.     server jobs-service:3000 weight=10 max_fails=3 fail_timeout=30s;
  13.     server profiles-service:3000 weight=10 max_fails=3 fail_timeout=30s;
  14.     server users-service:3000 weight=10 max_fails=3 fail_timeout=30s;
  15.   }
  16.  
  17.   server {
  18.       listen 80;
  19.       listen [::]:80;
  20.       server_name webapp-service.io;
  21.  
  22.       location / {
  23.         proxy_pass http://webapp-service.io;
  24.         proxy_http_version 1.1;
  25.         proxy_redirect off;
  26.         proxy_buffering off;
  27.         proxy_set_header Host $host;
  28.         proxy_set_header Upgrade $http_upgrade;
  29.         proxy_set_header Connection "upgrade";
  30.         proxy_cache_bypass $http_upgrade;
  31.       }
  32.   }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement