nginx to proxy ELK





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







1















I'm trying to proxy a backend server running ELK. Here's my environment info:



root@proxy:~#
root@proxy:~# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@proxy:~#
root@proxy:~# nginx -v
nginx version: nginx/1.14.0 (Ubuntu)
root@proxy:~#
root@proxy:~# cat /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}
root@proxy:~#
root@proxy:~# cat /etc/nginx/conf.d/elk.conf
server {
listen 80;
server_name domain.tld;
return 301 https://$host$request_uri;
}

server {
listen 443 default_server ssl;
server_name domain.tld;

ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;

location / {
root /usr/share/nginx/html;
index index.html;
}

location /elk {
proxy_pass http://1.2.3.4:5601;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
root@proxy:~#


With the above configurations, when I go to https://domain.tld, I can view my static site without issues but when I go to https://domain.tld/elk, I get a 404 Not Found. Here's the Raw Data of the 404:



{"statusCode":404,"error":"Not Found","message":"Not Found"}


Here's the Headers:



Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Fri, 04 Jan 2019 11:42:55 GMT
Server: nginx/1.14.0 (Ubuntu)
Transfer-Encoding: chunked
cache-control: no-cache
content-encoding: gzip
kbn-name: kibana
kbn-xpack-sig: d39f386737f81acb1fe7cc2cc4d80109
vary: accept-encoding

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
DNT: 1
Host: domain.tld
Referer: https://domain.tld/
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0


If I make my config as this:



root@proxy:~# cat /etc/nginx/conf.d/elk.conf
server {
listen 80;
server_name domain.tld;
return 301 https://$host$request_uri;
}

server {
listen 443 default_server ssl;
server_name domain.tld;

ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;

location / {
proxy_pass http://1.2.3.4:5601;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
root@proxy:~#


and go to https://domain.tld, it will proxy back to ELK correctly and the Kibana dashboard loads properly.



Been tinkering around, researched online and adjusted the samples accordingly but cannot make it to work the way I wanted. Appreciate your help. Thanks!










share|improve this question

























  • This is a guess, but you probably need to tell Kibana that it's root is at /elk and not /. Otherwise it might be trying to access resources at the root, these requests would likely be handled by nginx and return 404 errors.

    – kristaps
    Jan 4 at 12:29











  • Thank you, kristaps. Your comment made sense after reading (discuss.elastic.co/t/kibana-and-nginx-in-subpath/90280) - this led me to figure out the answer which @kahveci mentioned.

    – bad rabbit
    Jan 7 at 1:47




















1















I'm trying to proxy a backend server running ELK. Here's my environment info:



root@proxy:~#
root@proxy:~# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@proxy:~#
root@proxy:~# nginx -v
nginx version: nginx/1.14.0 (Ubuntu)
root@proxy:~#
root@proxy:~# cat /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}
root@proxy:~#
root@proxy:~# cat /etc/nginx/conf.d/elk.conf
server {
listen 80;
server_name domain.tld;
return 301 https://$host$request_uri;
}

server {
listen 443 default_server ssl;
server_name domain.tld;

ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;

location / {
root /usr/share/nginx/html;
index index.html;
}

location /elk {
proxy_pass http://1.2.3.4:5601;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
root@proxy:~#


With the above configurations, when I go to https://domain.tld, I can view my static site without issues but when I go to https://domain.tld/elk, I get a 404 Not Found. Here's the Raw Data of the 404:



{"statusCode":404,"error":"Not Found","message":"Not Found"}


Here's the Headers:



Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Fri, 04 Jan 2019 11:42:55 GMT
Server: nginx/1.14.0 (Ubuntu)
Transfer-Encoding: chunked
cache-control: no-cache
content-encoding: gzip
kbn-name: kibana
kbn-xpack-sig: d39f386737f81acb1fe7cc2cc4d80109
vary: accept-encoding

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
DNT: 1
Host: domain.tld
Referer: https://domain.tld/
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0


If I make my config as this:



root@proxy:~# cat /etc/nginx/conf.d/elk.conf
server {
listen 80;
server_name domain.tld;
return 301 https://$host$request_uri;
}

server {
listen 443 default_server ssl;
server_name domain.tld;

ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;

location / {
proxy_pass http://1.2.3.4:5601;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
root@proxy:~#


and go to https://domain.tld, it will proxy back to ELK correctly and the Kibana dashboard loads properly.



Been tinkering around, researched online and adjusted the samples accordingly but cannot make it to work the way I wanted. Appreciate your help. Thanks!










share|improve this question

























  • This is a guess, but you probably need to tell Kibana that it's root is at /elk and not /. Otherwise it might be trying to access resources at the root, these requests would likely be handled by nginx and return 404 errors.

    – kristaps
    Jan 4 at 12:29











  • Thank you, kristaps. Your comment made sense after reading (discuss.elastic.co/t/kibana-and-nginx-in-subpath/90280) - this led me to figure out the answer which @kahveci mentioned.

    – bad rabbit
    Jan 7 at 1:47
















1












1








1








I'm trying to proxy a backend server running ELK. Here's my environment info:



root@proxy:~#
root@proxy:~# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@proxy:~#
root@proxy:~# nginx -v
nginx version: nginx/1.14.0 (Ubuntu)
root@proxy:~#
root@proxy:~# cat /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}
root@proxy:~#
root@proxy:~# cat /etc/nginx/conf.d/elk.conf
server {
listen 80;
server_name domain.tld;
return 301 https://$host$request_uri;
}

server {
listen 443 default_server ssl;
server_name domain.tld;

ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;

location / {
root /usr/share/nginx/html;
index index.html;
}

location /elk {
proxy_pass http://1.2.3.4:5601;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
root@proxy:~#


With the above configurations, when I go to https://domain.tld, I can view my static site without issues but when I go to https://domain.tld/elk, I get a 404 Not Found. Here's the Raw Data of the 404:



{"statusCode":404,"error":"Not Found","message":"Not Found"}


Here's the Headers:



Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Fri, 04 Jan 2019 11:42:55 GMT
Server: nginx/1.14.0 (Ubuntu)
Transfer-Encoding: chunked
cache-control: no-cache
content-encoding: gzip
kbn-name: kibana
kbn-xpack-sig: d39f386737f81acb1fe7cc2cc4d80109
vary: accept-encoding

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
DNT: 1
Host: domain.tld
Referer: https://domain.tld/
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0


If I make my config as this:



root@proxy:~# cat /etc/nginx/conf.d/elk.conf
server {
listen 80;
server_name domain.tld;
return 301 https://$host$request_uri;
}

server {
listen 443 default_server ssl;
server_name domain.tld;

ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;

location / {
proxy_pass http://1.2.3.4:5601;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
root@proxy:~#


and go to https://domain.tld, it will proxy back to ELK correctly and the Kibana dashboard loads properly.



Been tinkering around, researched online and adjusted the samples accordingly but cannot make it to work the way I wanted. Appreciate your help. Thanks!










share|improve this question
















I'm trying to proxy a backend server running ELK. Here's my environment info:



root@proxy:~#
root@proxy:~# cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.1 LTS"
NAME="Ubuntu"
VERSION="18.04.1 LTS (Bionic Beaver)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 18.04.1 LTS"
VERSION_ID="18.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=bionic
UBUNTU_CODENAME=bionic
root@proxy:~#
root@proxy:~# nginx -v
nginx version: nginx/1.14.0 (Ubuntu)
root@proxy:~#
root@proxy:~# cat /etc/nginx/nginx.conf
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

}
root@proxy:~#
root@proxy:~# cat /etc/nginx/conf.d/elk.conf
server {
listen 80;
server_name domain.tld;
return 301 https://$host$request_uri;
}

server {
listen 443 default_server ssl;
server_name domain.tld;

ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;

location / {
root /usr/share/nginx/html;
index index.html;
}

location /elk {
proxy_pass http://1.2.3.4:5601;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
root@proxy:~#


With the above configurations, when I go to https://domain.tld, I can view my static site without issues but when I go to https://domain.tld/elk, I get a 404 Not Found. Here's the Raw Data of the 404:



{"statusCode":404,"error":"Not Found","message":"Not Found"}


Here's the Headers:



Connection: keep-alive
Content-Type: application/json; charset=utf-8
Date: Fri, 04 Jan 2019 11:42:55 GMT
Server: nginx/1.14.0 (Ubuntu)
Transfer-Encoding: chunked
cache-control: no-cache
content-encoding: gzip
kbn-name: kibana
kbn-xpack-sig: d39f386737f81acb1fe7cc2cc4d80109
vary: accept-encoding

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.5
Connection: keep-alive
DNT: 1
Host: domain.tld
Referer: https://domain.tld/
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0


If I make my config as this:



root@proxy:~# cat /etc/nginx/conf.d/elk.conf
server {
listen 80;
server_name domain.tld;
return 301 https://$host$request_uri;
}

server {
listen 443 default_server ssl;
server_name domain.tld;

ssl_certificate /etc/letsencrypt/live/domain.tld/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domain.tld/privkey.pem;

location / {
proxy_pass http://1.2.3.4:5601;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}
}
root@proxy:~#


and go to https://domain.tld, it will proxy back to ELK correctly and the Kibana dashboard loads properly.



Been tinkering around, researched online and adjusted the samples accordingly but cannot make it to work the way I wanted. Appreciate your help. Thanks!







nginx kibana reverse-proxy elastic-stack






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 6 at 5:33









kahveci

519315




519315










asked Jan 4 at 11:59









bad rabbitbad rabbit

83




83













  • This is a guess, but you probably need to tell Kibana that it's root is at /elk and not /. Otherwise it might be trying to access resources at the root, these requests would likely be handled by nginx and return 404 errors.

    – kristaps
    Jan 4 at 12:29











  • Thank you, kristaps. Your comment made sense after reading (discuss.elastic.co/t/kibana-and-nginx-in-subpath/90280) - this led me to figure out the answer which @kahveci mentioned.

    – bad rabbit
    Jan 7 at 1:47





















  • This is a guess, but you probably need to tell Kibana that it's root is at /elk and not /. Otherwise it might be trying to access resources at the root, these requests would likely be handled by nginx and return 404 errors.

    – kristaps
    Jan 4 at 12:29











  • Thank you, kristaps. Your comment made sense after reading (discuss.elastic.co/t/kibana-and-nginx-in-subpath/90280) - this led me to figure out the answer which @kahveci mentioned.

    – bad rabbit
    Jan 7 at 1:47



















This is a guess, but you probably need to tell Kibana that it's root is at /elk and not /. Otherwise it might be trying to access resources at the root, these requests would likely be handled by nginx and return 404 errors.

– kristaps
Jan 4 at 12:29





This is a guess, but you probably need to tell Kibana that it's root is at /elk and not /. Otherwise it might be trying to access resources at the root, these requests would likely be handled by nginx and return 404 errors.

– kristaps
Jan 4 at 12:29













Thank you, kristaps. Your comment made sense after reading (discuss.elastic.co/t/kibana-and-nginx-in-subpath/90280) - this led me to figure out the answer which @kahveci mentioned.

– bad rabbit
Jan 7 at 1:47







Thank you, kristaps. Your comment made sense after reading (discuss.elastic.co/t/kibana-and-nginx-in-subpath/90280) - this led me to figure out the answer which @kahveci mentioned.

– bad rabbit
Jan 7 at 1:47














1 Answer
1






active

oldest

votes


















0














Basically, you need to make two changes to solve the issue. First, please add slashes at the end of location and proxy_pass directive in Nginx server block file as follows:



location /elk/ {
proxy_pass http://1.2.3.4:5601/;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}


Second, please uncomment server.basePath setting and give the value of /elk in kibana.yml config file:



server.basePath: "/elk"


Finally, you must restart both Nginx and Kibana before giving it another try.






share|improve this answer
























  • Thank you, @kahveci. This works.

    – bad rabbit
    Jan 7 at 1:51














Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54038561%2fnginx-to-proxy-elk%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














Basically, you need to make two changes to solve the issue. First, please add slashes at the end of location and proxy_pass directive in Nginx server block file as follows:



location /elk/ {
proxy_pass http://1.2.3.4:5601/;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}


Second, please uncomment server.basePath setting and give the value of /elk in kibana.yml config file:



server.basePath: "/elk"


Finally, you must restart both Nginx and Kibana before giving it another try.






share|improve this answer
























  • Thank you, @kahveci. This works.

    – bad rabbit
    Jan 7 at 1:51


















0














Basically, you need to make two changes to solve the issue. First, please add slashes at the end of location and proxy_pass directive in Nginx server block file as follows:



location /elk/ {
proxy_pass http://1.2.3.4:5601/;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}


Second, please uncomment server.basePath setting and give the value of /elk in kibana.yml config file:



server.basePath: "/elk"


Finally, you must restart both Nginx and Kibana before giving it another try.






share|improve this answer
























  • Thank you, @kahveci. This works.

    – bad rabbit
    Jan 7 at 1:51
















0












0








0







Basically, you need to make two changes to solve the issue. First, please add slashes at the end of location and proxy_pass directive in Nginx server block file as follows:



location /elk/ {
proxy_pass http://1.2.3.4:5601/;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}


Second, please uncomment server.basePath setting and give the value of /elk in kibana.yml config file:



server.basePath: "/elk"


Finally, you must restart both Nginx and Kibana before giving it another try.






share|improve this answer













Basically, you need to make two changes to solve the issue. First, please add slashes at the end of location and proxy_pass directive in Nginx server block file as follows:



location /elk/ {
proxy_pass http://1.2.3.4:5601/;
proxy_http_version 1.1;
proxy_set_header Connection "Keep-Alive";
proxy_set_header Proxy-Connection "Keep-Alive";
}


Second, please uncomment server.basePath setting and give the value of /elk in kibana.yml config file:



server.basePath: "/elk"


Finally, you must restart both Nginx and Kibana before giving it another try.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 5 at 19:21









kahvecikahveci

519315




519315













  • Thank you, @kahveci. This works.

    – bad rabbit
    Jan 7 at 1:51





















  • Thank you, @kahveci. This works.

    – bad rabbit
    Jan 7 at 1:51



















Thank you, @kahveci. This works.

– bad rabbit
Jan 7 at 1:51







Thank you, @kahveci. This works.

– bad rabbit
Jan 7 at 1:51






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54038561%2fnginx-to-proxy-elk%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Mossoró

Can't read property showImagePicker of undefined in react native iOS

Pushsharp Apns notification error: 'InvalidToken'