# Marvel + Nginx

**URL:** <https://discuss.elastic.co/t/marvel-nginx/29920>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-monitoring\
**Created:** [September 24, 2015, 1:44pm UTC](https://discuss.elastic.co/t/marvel-nginx/29920 "2015-09-24T13:44:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom\_jonge](https://avatars.discourse-cdn.com/v4/letter/t/7ba0ec/32.png) [@tom\_jonge](https://discuss.elastic.co/u/tom_jonge)\
**Post date:** [September 24, 2015, 1:44pm UTC](https://discuss.elastic.co/t/marvel-nginx/29920/1 "2015-09-24T13:44:27Z")

</div>

Hello again,

Trying to get Marvel's dashboard working behind Nginx. Everything works if I bypass Nginx by going to [http://myserver:9200/\_plugin/marvel/](http://myserver:9200/_plugin/marvel/). Going through Nginx by going to [http://my-server/marvel/](http://my-server/marvel/) gives me an empty dashboard. Url goes up to [http://myserver/marvel/kibana/index.html#/dashboard](http://myserver/marvel/kibana/index.html#/dashboard) and then stops.

With Nginx:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/5/5babe4513df7a01410fba661f0f2b30005406d52.png)  
Without Nginx:  
 ![](https://us1.discourse-cdn.com/elastic/original/2X/4/44a05d06204902500b4ea559283e9d565a807b4a.png)

Nginx sites-available:

```
server {
    listen 80;

    auth_basic "Restricted Access";
    auth_basic_user_file /etc/nginx/htpasswd.users;

    location /kibana/ {
        proxy_http_version 1.1;
        proxy_ignore_headers Cache-Control;
        proxy_pass http://localhost:5601/;
        proxy_read_timeout 90;
        proxy_redirect off;
        proxy_set_header Authorization '';
        proxy_set_header Connection "";
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
     }

     location /marvel/ {
        proxy_http_version 1.1;
        proxy_ignore_headers Cache-Control;
        proxy_pass http://localhost:9200/_plugin/marvel/;
        proxy_read_timeout 90;
        proxy_redirect off;
        proxy_set_header Authorization '';
        proxy_set_header Connection "";
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
     }
}

```

Nginx error logs show the following:

```
2015/09/24 14:58:42 [error] 19623#0: *241 open() "/usr/share/nginx/html/_nodes" failed (2: No such file or directory), client: <my public ip>, server: , request: "GET /_nodes HTTP/1.1", host: "my-server", referrer: "http://my-server/marvel/kibana/index.html"

```

It's trying to get /\_nodes, but is looking for it in Nginx's own directory.

The only mentions of \_nodes I could find below:

> **./plugins/marvel/\_site/sense/app/kb/api\_0\_90/nodes.js** :define(,function(){return function(n){n.addEndpointDescription(" **\_nodes** /hot\_threads",{methods:["GET"],patterns:[" **\_nodes** /hot\_threads"," **\_nodes** /{nodes}/hot\_threads"]})}});

> **./plugins/marvel/\_site/sense/app/kb/api\_1\_0/nodes.js:define([],function(){return function(e){e.addEndpointDescription("\_nodes**/hot\_threads",{methods:["GET"],patterns:[" **\_nodes** /hot\_threads"," **\_nodes** /{nodes}/hot\_threads"]}),e.addEndpointDescription(" **\_nodes** /info",{patterns:[" **\_nodes**","\_nodes/{metrics}"," **\_nodes** /{nodes}"," **\_nodes** /{nodes}/{metrics}"," **\_nodes** /{nodes}/info/{metrics}"],url\_components:{metrics:["settings","os","process","jvm","thread\_pool","network","transport","http","plugins","\_all"]}}),e.addEndpointDescription(" **\_nodes** /stats",{patterns:[" **\_nodes** /stats"," **\_nodes** /stats/{metrics}"," **\_nodes** /stats/{metrics}/{index\_metric}"," **\_nodes** /{nodes}/stats"," **\_nodes** /{nodes}/stats/{metrics}"," **\_nodes** /{nodes}/stats/{metrics}/{index\_metric}"],url\_components:{metrics:["os","jvm","thread\_pool","network","fs","transport","http","indices","process","breaker","\_all"],index\_metric:["store","indexing","get","search","merge","flush","refresh","filter\_cache","id\_cache","fielddata","docs","warmer","percolate","completion","segments","translog","query\_cache","\_all"]}})}});

---

<div class="post-metadata">

**Author:** ![niraj\_kumar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/niraj_kumar/32/4130_2.png) [@niraj\_kumar](https://discuss.elastic.co/u/niraj_kumar)\
**Post date:** [September 25, 2015, 4:30am UTC](https://discuss.elastic.co/t/marvel-nginx/29920/2 "2015-09-25T04:30:50Z")

</div>

Can you paste the entire config. Including where the root is pointing to.

---

<div class="post-metadata">

**Author:** ![jamiel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jamiel/32/6025_2.png) [@jamiel](https://discuss.elastic.co/u/jamiel)\
**Post date:** [November 19, 2015, 11:13am UTC](https://discuss.elastic.co/t/marvel-nginx/29920/3 "2015-11-19T11:13:56Z")

</div>

You need to proxy /\_nodes to your elasticsearch instance. Add in:

location /\_nodes {  
proxy\_http\_version 1.1;  
proxy\_ignore\_headers Cache-Control;  
proxy\_pass [http://localhost:9200/\_nodes;](http://localhost:9200/_nodes;)  
proxy\_read\_timeout 90;  
proxy\_redirect off;  
proxy\_set\_header Authorization '';  
proxy\_set\_header Connection "";  
proxy\_set\_header Host $http\_host;  
proxy\_set\_header X-Forwarded-For $proxy\_add\_x\_forwarded\_for;  
proxy\_set\_header X-Forwarded-Proto $scheme;  
}

Or simply add a default proxy to send everything to your ES instance if your security circumstances allows it.

---

<div class="post-metadata">

**Author:** ![Luc\_Suryo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/luc_suryo/32/3259_2.png) [@Luc\_Suryo](https://discuss.elastic.co/u/Luc_Suryo)\
**Post date:** [May 3, 2016, 4:45pm UTC](https://discuss.elastic.co/t/marvel-nginx/29920/4 "2016-05-03T16:45:41Z")

</div>

I tried the above config but still having issues. Marvel comes up but no data, with the url :9200/\_plugin/marvel is see the clients.... we are only allowed to expose port 80 or 443 so  
without a working setup we can use Marvel, fyi the kopf plugin works just find...

full config

server {

```
listen 80 ;
server_name marvel.internal.momo.net;

location /marvel/ {
    proxy_http_version 1.1;
    proxy_ignore_headers Cache-Control;
    proxy_pass http://localhost:9200/_plugin/marvel/;
    proxy_read_timeout 90;
    proxy_redirect off;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

location /_nodes {
    proxy_http_version 1.1;
    proxy_ignore_headers Cache-Control;
    proxy_pass http://localhost:9200/_nodes;
    proxy_read_timeout 90;
    proxy_redirect off;
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

```

ES 1.7.3 with latest Marvel 1.3

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 1:43pm UTC](https://discuss.elastic.co/t/marvel-nginx/29920/5 "2017-07-06T13:43:39Z")

</div>


