mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Add local cdn
This commit is contained in:
parent
ac88cfbdbb
commit
7a19523fa4
24
devenv/local_cdn/default.conf
Normal file
24
devenv/local_cdn/default.conf
Normal file
@ -0,0 +1,24 @@
|
||||
server {
|
||||
root /data;
|
||||
autoindex on;
|
||||
|
||||
location / {
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
add_header 'Access-Control-Allow-Headers' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' '*';
|
||||
# add_header 'Access-Control-Max-Age' 1728000;
|
||||
add_header 'Content-Type' 'text/plain; charset=utf-8';
|
||||
add_header 'Content-Length' 0;
|
||||
return 204;
|
||||
}
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' '$http_origin' always;
|
||||
add_header 'Access-Control-Allow-Methods' '*' always;
|
||||
add_header 'Access-Control-Allow-Headers' '*' always;
|
||||
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||||
|
||||
rewrite ^/grafana-oss/11.0.0-pre/public(.*)$ $1 last;
|
||||
}
|
||||
}
|
11
devenv/local_cdn/docker-compose.yaml
Normal file
11
devenv/local_cdn/docker-compose.yaml
Normal file
@ -0,0 +1,11 @@
|
||||
version: '2'
|
||||
|
||||
services:
|
||||
grafana_local_cdn:
|
||||
image: nginx:alpine
|
||||
container_name: grafana_local_cdn
|
||||
ports:
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ../../public:/data
|
||||
- ./default.conf:/etc/nginx/conf.d/default.conf
|
Loading…
Reference in New Issue
Block a user