nginx server location mapping conflict

14 Views Asked by At

I'm trying to run vault and consul, i'm using nginx :

location /app {
    deny all;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://vault-consul:8500;
  }
location / {
    deny all;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Server $host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_pass http://vault-app:8200;
  }

the problem is when I restart nginx ; and hit https://domai-name.com/app it redirect me to https://domai-name.com/ui whichis the user interface for vault-app and not vault-consul, could you help please ?

0

There are 0 best solutions below