Skip to content

Instantly share code, notes, and snippets.

@nezarfadle
Created January 19, 2018 13:50
Show Gist options
  • Save nezarfadle/fd559cf6d5900b677d41ad8409833571 to your computer and use it in GitHub Desktop.
Save nezarfadle/fd559cf6d5900b677d41ad8409833571 to your computer and use it in GitHub Desktop.
server {
    listen 80;

    location /users {
        proxy_set_header Host $host;
        proxy_pass http://users_web/;
    }

    location /admins {
        proxy_set_header Host $host;
        proxy_pass http://admins_web/;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    
}
version: "3"
services:
  web:
    image: users
    deploy:
      replicas: 2
    networks:
      - proxy

networks:  
  proxy:
    external: true
version: "3"
services:
  proxy:
    image: nginx
    ports:
      - 9090:80
    networks:
      - proxy
  web:
    image: admins
    deploy:
      replicas: 2
    networks:
      - proxy

networks:  
  proxy:
    external: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment