Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I allow multiple presto coordinator's urls from NGINX #719

Open
nikeshthakre opened this issue Aug 28, 2019 · 1 comment
Open

How can I allow multiple presto coordinator's urls from NGINX #719

nikeshthakre opened this issue Aug 28, 2019 · 1 comment

Comments

@nikeshthakre
Copy link

I wanna allow two presto urls from nginx. bellow is the configuration of nginx.
presto-1 IP :172.18.0.14
presto-2 IP :172.18.0.12
but only one presto coordinator is running at a time. I wanna allow both presto working.

Below is the content of this file /etc/nginx/conf.d/ssl.conf :

server {
listen 443 ssl;
server_name _;

ssl_certificate             /root/server.crt;
ssl_certificate_key         /root/server.key;
ssl_protocols               TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers                 HIGH:!aNULL:!MD5;

# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;

location /presto-1/{
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://172.18.0.14:8443/;
}
location /presto-2/{
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://172.18.0.12:8443/;
}
location /v1/query/{
proxy_pass https://172.18.0.14:8443/v1/query/;
}
location /v1/cluster/{
proxy_pass https://172.18.0.14:8443/v1/cluster/;
}
location /v1/info/{
proxy_pass http://172.18.0.14:9090/v1/info;
}
}

@nikeshthakre
Copy link
Author

If I am repeating the location for ip 172.18.0.12 then nginx throwing an error of duplicate location.

location /presto-1/{
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://172.18.0.14:8443/;
}
location /presto-2/{
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://172.18.0.12:8443/;
}
location /v1/query/{
proxy_pass https://172.18.0.14:8443/v1/query/;
}
location /v1/cluster/{
proxy_pass https://172.18.0.14:8443/v1/cluster/;
}
location /v1/info/{
proxy_pass http://172.18.0.14:9090/v1/info;
}
location /timeline{
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://172.18.0.14:8443/timeline;
}
location /v1/query/{
proxy_pass https://172.18.0.12:8443/v1/query/;
}
location /v1/cluster/{
proxy_pass https://172.18.0.12:8443/v1/cluster/;
}
location /v1/info/{
proxy_pass http://172.18.0.12:9090/v1/info;
}
location /timeline{
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_pass https://172.18.0.12:8443/timeline;
}
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant