Score:0

two location nginx to the same upstream Kibana

ar flag

I have to manage and create two location nginx that point to the same upstream Kibana application, one with authentication and the other without authentication but I'm stuck here at this point. my config below:

nginx.conf

upstream kibana_backend {
    server 192.168.1.20:5601;
}

server {
    listen 80 default_server;
      location / {
        if ($scheme = 'http') {
          rewrite ^ https://$http_host$request_uri? permanent;
        }
      }

    listen  443 ssl;
    server_name tool.example.com;


 location ^~/without_authentication/app/kibana/{

     proxy_set_header X-Real-IP  $remote_addr;
     proxy_set_header X-Forwarded-For $remote_addr;
     proxy_set_header Host $host;   
     proxy_set_header Host $host;
     rewrite ^/without_authentication(.*) /$1 break;
     proxy_pass http://kibana_backend;
 }

    location ^~/with_authentication/app/kibana/{
     proxy_set_header X-Real-IP  $remote_addr;
     proxy_set_header X-Forwarded-For $remote_addr;
     proxy_set_header Host $host;
     auth_basic      
     auth_basic_user_file /etc/nginx/.htpasswd;
     proxy_set_header Host $host;
     rewrite ^/with(.*) /$1 break;
     proxy_pass http://kibana_backend;
 }

kibana.yaml

server.publicBaseUrl: "https://tool.example.com/app/kibana"
server.basePath: "/app/kibana"

If I want to access https://tool.example.com/with_authentication/app/kibana doesn't do nothing.

djdomi avatar
za flag
does do nothing is not a error description. please provide error and access logs, show the complete configuration of all involved servers and daemons
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.