Sharing Hashicorp Vault and Consul UI under one roof behind NGINX proxy_pass
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 43
Description
### Overview of the Issue
It might come in handy sometimes to share both Vault and Consul UI under the same roof behind nginx.
### Describe the solution
This is the solution we ended up implementing and it worked well...
A single configuration location file for nginx to hide on the same host
consul and vault in `/ui//`
### Consul Version
Consul version 1.10.3
Vault version 1.8.5
### Solution
```nginx
location /ui {
if ($http_referer ~ (/ui/vault)) {
proxy_pass http://127.0.0.1:8200;
}
if ($http_referer ~ (/ui/consul)) {
proxy_pass http://127.0.0.1:8500;
}
}
location /v1 {
if ($http_referer ~ (/ui/vault)) {
proxy_pass http://127.0.0.1:8200;
}
if ($http_referer ~ (/ui/consul)) {
proxy_pass http://127.0.0.1:8500;
}
}
location /ui/vault/ {
proxy_pass http://127.0.0.1:8200/ui/;
}
location /ui/consul {
proxy_pass http://127.0.0.1:8500;
}
```
### Additionnal Notes
- Make sure to set `-ui-content-path=/ui/consul/` when starting consul.
Contributor guide
Assessment
This issue has not been assessed yet.