title: How to get nginx logs to display in prometheus?
body: <p>I have a nginx docker image running on random port <a href="http://localhost:32774" rel="nofollow noreferrer">http://localhost:32774</a>
  I also have a prometheus docker image running on <a href="http://localhost:9090/" rel="nofollow noreferrer">http://localhost:9090/</a>
  I want to see my nginx logs display on my prometheus </p>
  
  <p>I already have setup up nginx_status on my nginx container and when i curl
  I am able to see both the Nginx page as well as <a href="http://localhost/nginx_status" rel="nofollow noreferrer">http://localhost/nginx_status</a> page when i am in the container </p>
  
  <p>I can view <a href="http://localhost:9090/graph" rel="nofollow noreferrer">http://localhost:9090/graph</a> --Prometheus
  I can view <a href="http://localhost:32774" rel="nofollow noreferrer">http://localhost:32774</a> --- nginx on my local browser
  I am not able to view <a href="http://localhost:32774/nginx_status" rel="nofollow noreferrer">http://localhost:32774/nginx_status</a> -- 403 forbidden access 
  what is the idea behind nginxexporter I have it as a container running on localhost:9113</p>
  
  <p>My goal is to get nginx logs displayed on Prometheus </p>
  
  <p>here is my default.conf </p>
  
  <pre><code>server {
  listen       80;
  server_name  localhost;
  
  #charset koi8-r;
  #access_log  /var/log/nginx/host.access.log  main;
  
  location / {
      root   /usr/share/nginx/html;
      index  index.html index.htm;
  }
  location /nginx_status {
      stub_status on;
  
      access_log off;
      allow 127.0.0.1;
      allow ::1;
      deny all;
  }
  
  
  #error_page  404              /404.html;
  
  # redirect server error pages to the static page /50x.html
  #
  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
      root   /usr/share/nginx/html;
  }
  
  # proxy the PHP scripts to Apache listening on 127.0.0.1:80
  #
  #location ~ \.php$ {
  #    proxy_pass   http://127.0.0.1;
  #}
  
  # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  #
  #location ~ \.php$ {
  #    root           html;
  #    fastcgi_pass   127.0.0.1:9000;
  #    fastcgi_index  index.php;
  #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
  #    include        fastcgi_params;
  #}
  
  # deny access to .htaccess files, if Apache's document root
  # concurs with nginx's one
  #
  #location ~ /\.ht {
  #    deny  all;
  #}
  }
  </code></pre>