添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
无邪的大熊猫  ·  springboot k8s - CSDN文库·  1 周前    · 
买醉的墨镜  ·  Exception in thread ...·  2 月前    · 
心软的钥匙扣  ·  Database.Execute ...·  8 月前    · 
乐观的灭火器  ·  DataBinding ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm trying to set up graphite to work with grafana in docker based on this project : https://github.com/kamon-io/docker-grafana-graphite

and when I run my dockerfile I get 403 Forbidden error for nginx.

my configurations for nginx are almost the same as the project's configurations. I run my dockerfiles on a server and test them on my windows machine. So the configurations are not exactly the same ... for example I have :

server {
listen 80 default_server;
server_name _;
location / {
  root /src/grafana/dist;
  index index.html;
location /graphite/ {
    proxy_pass                 http:/myserver:8000/;
    proxy_set_header           X-Real-IP   $remote_addr;
    proxy_set_header           X-Forwarded-For  $proxy_add_x_forwarded_for;
    proxy_set_header           X-Forwarded-Proto  $scheme;
    proxy_set_header           X-Forwarded-Server  $host;
    proxy_set_header           X-Forwarded-Host  $host;
    proxy_set_header           Host  $host;
    client_max_body_size       10m;
    client_body_buffer_size    128k;
    proxy_connect_timeout      90;
    proxy_send_timeout         90;
    proxy_read_timeout         90;
    proxy_buffer_size          4k;
    proxy_buffers              4 32k;
    proxy_busy_buffers_size    64k;
    proxy_temp_file_write_size 64k;
    add_header Access-Control-Allow-Origin "*";
    add_header Access-Control-Allow-Methods "GET, OPTIONS";
    add_header Access-Control-Allow-Headers "origin, authorization, accept";

But I still keep getting 403 forbidden. Checking the error log for nginx says :

 directory index of "/src/grafana/dist/" is forbidden

Stopping and running it again it says :

 directory index of "/src/grafana/dist/" is forbidden

I'm very new to nginx ... was wondering if there's something in the configurations that I'm misunderstanding.

Thanks in advance.

ah I see. I just looked in the /src/grafana/dist and there's no index.html. I'm assuming I have to add the index.html file manually? – tyrell_c Dec 4, 2014 at 21:26 1. 'index.html' exists. 2. You have the right permissions. nginx has read-access to the entire directory tree leading up to 'index.html'. That is, it must be able to read directories 'src', 'src/grafana' and 'src/grafana/dist' as well as 'index.html' itself. A hacky quick-fix to achieve this would be to do 'sudo chmod -R 755 /src', but I don't recommend it.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.