# APM answer with 404 using nginx proxy\_pass

**URL:** <https://discuss.elastic.co/t/apm-answer-with-404-using-nginx-proxy-pass/244970>\
**Category:** APM\
**Tags:** docker, server\
**Created:** [August 14, 2020, 8:00am UTC](https://discuss.elastic.co/t/apm-answer-with-404-using-nginx-proxy-pass/244970 "2020-08-14T08:00:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.ratnikov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a.ratnikov/32/45433_2.png) [@a.ratnikov](https://discuss.elastic.co/u/a.ratnikov)\
**Post date:** [August 14, 2020, 8:00am UTC](https://discuss.elastic.co/t/apm-answer-with-404-using-nginx-proxy-pass/244970/1 "2020-08-14T08:00:25Z")

</div>

Greetings everyone!  
I want to use nginx proxy\_pass with APM server.  
🟢 APM server endpoint works for full url with open port: [http://IP:8200/](http://IP:8200/)

```auto
    {
      "build_date": "2020-07-21T14:00:32Z",
      "build_sha": "f1a08a22e814d19ee01d5d714430a851552d4937",
      "version": "7.8.1"
    }

```

If I'm using nginx proxy\_pass with this config [http://mydomain.com/group/apm/:](http://mydomain.com/group/apm/:)

```auto
    server {
        include default_proxy_headers;
        set $upstream_test_apmendpoint http://Test_apm-server:8200;
        resolver 127.0.0.11 ipv6=off valid=10s;
        server_name test.mydomain.com;
        location /group/apm/ {
            proxy_buffering off;
            proxy_pass $upstream_test_apmendpoint;
            add_header Cache-Control "no-cache";
        }
    }

```

I've got this:

```auto
    {
      "error": "404 page not found"
    }

```

And in the apm server I've got this error.

```auto
2020-08-14T07:33:22.788Z	ERROR	[request]	middleware/log_middleware.go:95	404 page not found	{"request_id": "a30bdffe-09db-4f7f-ab65-1b5ddedfcae2", "method": "GET", "URL": "/seller/apm/", "content_length": 0, "remote_address": "83.242.98.64", "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:79.0) Gecko/20100101 Firefox/79.0", "response_code": 404, "error": "404 page not found"}

```

**APM Server version** : apm-server; Version: 7.8.1  
**APM Server Config** :

```auto
    apm-server: 
      host: "0.0.0.0:8200"
      rum: 
        allow_headers: []
        allow_origins: 
          - "*"
        enabled: true
        event_rate: 
          limit: 300
          lru_size: 1000
    output.elasticsearch: 
      hosts: 
        - "elasticsearch:9200"
      password: "secret"
      username: elastic

```

---

<div class="post-metadata">

**Author:** ![a.ratnikov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/a.ratnikov/32/45433_2.png) [@a.ratnikov](https://discuss.elastic.co/u/a.ratnikov)\
**Post date:** [August 14, 2020, 8:21am UTC](https://discuss.elastic.co/t/apm-answer-with-404-using-nginx-proxy-pass/244970/2 "2020-08-14T08:21:07Z")

</div>

The problem was in trailing slash in nginx config. The right part is

```auto
    location /group/apm/ {
        proxy_buffering off;
        proxy_pass http://Test_apm-server:8200/;
        add_header Cache-Control "no-cache";
    }

```

---

<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:** [September 4, 2020, 4:21am UTC](https://discuss.elastic.co/t/apm-answer-with-404-using-nginx-proxy-pass/244970/3 "2020-09-04T04:21:07Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
