worker_processes 10;

events { worker_connections 4096; }


http {
    server_tokens off;
    upstream leaves {
           server 178.128.159.51:81;
    }  
    upstream leaves.topic {
           server 178.128.159.51:82;
    }
    upstream docker-wallabag {
           server 178.128.159.51:100;
    }
    upstream docker-phyMyAdmin {
           server 178.128.159.51:83;
    }


    server {
	listen 80;
	
	gzip on;
	gzip_types *;
	gzip_proxied any;

        location / {
            proxy_pass http://leaves;
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            }

        location /topic {
            proxy_pass http://leaves.topic/;
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            }
	
	location /wb {
            proxy_pass         http://docker-wallabag/login;
            proxy_set_header   Host $host;
            proxy_set_header   X-Real-IP $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
	    }
    location /admin {
            proxy_pass         http://docker-phyMyAdmin/;
            proxy_set_header   Host $host;
            proxy_set_header   X-Real-IP $remote_addr;
            proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
            }
    }
}
