-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OpenAPI: Fix API calls pointing to subpath (#1145)
Closes #1137 Currently, the test suite is pointing to a subpath BUT Grafana redirects from the root to the subpath The provider is badly configured but the tests still pass because of the redirect To fix the test suite, I add a nginx proxy in this PR, so that calling the host directly fails and you have to go through the subpath I've also reworked the Makefile so that it has more common args (less repetition of configs), so it's harder to make a mistake
- Loading branch information
1 parent
6892869
commit b19e8db
Showing
4 changed files
with
74 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
events{} | ||
|
||
http { | ||
# this is required to proxy Grafana Live WebSocket connections. | ||
map $http_upgrade $connection_upgrade { | ||
default upgrade; | ||
'' close; | ||
} | ||
|
||
upstream grafana { | ||
server grafana:3000; | ||
} | ||
|
||
server { | ||
listen 3001; | ||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
server_name 0.0.0.0; | ||
|
||
location /grafana/ { | ||
proxy_set_header Host $host; | ||
proxy_pass http://grafana; | ||
} | ||
|
||
# Proxy Grafana Live WebSocket connections. | ||
location /api/live/ { | ||
proxy_http_version 1.1; | ||
proxy_set_header Upgrade $http_upgrade; | ||
proxy_set_header Connection $connection_upgrade; | ||
proxy_set_header Host $host; | ||
proxy_pass http://grafana; | ||
} | ||
} | ||
} |