Answer the question
In order to leave comments, you need to log in
How is regex handled in nginx location?
Hello,
Playing with ELK stack in docker, I decided to get Kibana on external nginx. It is necessary to do it with the help of location and I came across the fact that if I add a working location for Kibana (it will be lower) - the others that already exist break.
I add this:
location ~ (|/app/kibana|/bundles/|/status|/plugins|/elasticsearch/|) {
proxy_pass http://192.168.1.10:5601;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
rewrite /(.*)$ /$1 break;
}
location /portainer/ {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_pass http://portainer/;
}
location ^~ /portainer/api/websocket/ {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_pass http://portainer/api/websocket/;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question