Commit 5ce64644 by Andrew Rodgers

Revert "added nginx conf examples for graphite CORS configuration"

This reverts commit c37496f2.
parent a0c3f99d
...@@ -71,14 +71,7 @@ Header set Access-Control-Allow-Headers "origin, authorization, accept" ...@@ -71,14 +71,7 @@ Header set Access-Control-Allow-Headers "origin, authorization, accept"
``` ```
Note that using "\*" leaves your graphite instance quite open so you might want to consider using "http://my.graphite-dom.ain" in place of "\*" Note that using "\*" leaves your graphite instance quite open so you might want to consider using "http://my.graphite-dom.ain" in place of "\*"
Here is the same thing, in nginx format: If your Graphite web is proteced by basic authentication, you have to enable the HTTP verb OPTIONS, origin
```
add_header "Access-Control-Allow-Origin" "*";
add_header "Access-Control-Allow-Credentials" "true";
add_header "Access-Control-Allow-Methods" "GET, OPTIONS";
add_header "Access-Control-Allow-Headers" "Authorization, origin, accept";
```
If your Graphite web is protected by basic authentication, you have to enable the HTTP verb OPTIONS, origin
(no wildcards are allowed in this case) and add Access-Control-Allow-Credentials. This looks like the following for Apache: (no wildcards are allowed in this case) and add Access-Control-Allow-Credentials. This looks like the following for Apache:
``` ```
Header set Access-Control-Allow-Origin "http://mygrafana.com:5656" Header set Access-Control-Allow-Origin "http://mygrafana.com:5656"
...@@ -93,18 +86,7 @@ Header set Access-Control-Allow-Credentials true ...@@ -93,18 +86,7 @@ Header set Access-Control-Allow-Credentials true
</LimitExcept> </LimitExcept>
</Location> </Location>
``` ```
And in nginx:
```
if ($http_origin ~* (https?://[^/]*\.somedomain\.com(:[0-9]+)?)) { #Test if request is from allowed domain, you can use multiple if
set $cors "true"; #statements to allow multiple domains, simply setting $cors to true in each one.
}
if ($cors = 'true') {
add_header Access-Control-Allow-Origin $http_origin;
add_header "Access-Control-Allow-Credentials" "true";
add_header "Access-Control-Allow-Methods" "GET, OPTIONS";
add_header "Access-Control-Allow-Headers" "Authorization, origin, accept";
}
```
# Roadmap # Roadmap
- Improve and refine the target parser and editing - Improve and refine the target parser and editing
- Improve graphite import feature - Improve graphite import feature
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment