nextcloud / nextcloud/notify_push

push server is not a trusted proxy

Open
#11 47 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
Rust
Stars
344
Forks
64
Avg merge
2d 10h
Merged PRs (30d)
5

Description

I guess this one is related to my config but I can't seem to make it work. I'm trying to setup notify_push using php occ notify_push:setup but I'm always getting a push server is not a trusted proxy no matter what I put into the trusted_proxies config.

Here's the relevant config:

  'trusted_proxies' =>
  array (
    0 => 'nginx-proxy-manager_app_1',
    1 => '172.18.0.8',
    2 => '172.0.0.1/8',
    3 => '127.0.0.1',
  ),

At first I only had the first value and tried adding the other ones but no luck. Here's the exact error message I get:

push server is not a trusted proxy, please add '172.18.0.8' to the list of trusted proxies or configure any existing reverse proxy to forward the 'x-forwarded-for' send by the push server.

My setup involves docker and nginx proxy manager.

Here's the nginx location config I'm using:

  location /push/ {
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Scheme $scheme;
    proxy_set_header X-Forwarded-Proto  $scheme;
    proxy_set_header X-Forwarded-For    $remote_addr;
    proxy_pass       http://nextcloud_notify_push_1:80/;
        proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
  }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the php occ notify_push:setup entry point and review the supplied trusted_proxies configuration alongside the Docker and Nginx /push/ location. Trace the forwarded address and headers through the proxy chain, then verify the setup command completes without the trusted-proxy error.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nginx, php
Domain
infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.