nginx-proxy-manager: Unable to federate matrix synapse using NPM

Checklist

  • Have you pulled and found the error with jc21/nginx-proxy-manager:latest docker image?
    • Yes
  • Are you sure you’re not using someone else’s docker image?
    • Yes
  • Have you searched for similar issues (both open and closed)?
    • Yes

Describe the bug Would I consider this a bug? I’m not sure but I have searched everywhere else, including posting on reddit, and am unable to find an answer so this is my last resort. If this is the wrong place I apologize.

A few details, I am using a subdomain, matrix.minnix.dev, for the actual matrix server and my homeserver.yaml lists my parent domain as minnix.dev so that my user name looks like minnix@minnix.dev within matrix instead of minnix@matrix.minnix.dev. I had a configuration working quite well just using plain nginx as a reverse proxy in front of my matrix server. I actually wrote a guide about the process here. I can’t get NPM to do the same thing though as I am failing the federation test here. My self-hosted matrix rooms are still available to other users and they can communicate with each other but they cannot see my communications and when I search for other rooms I get the message “Failed to fetch room list”

My old proxy configs looked like this before installing NPM:

For the matrix server-

    server {
        listen 443 ssl http2;
        listen [::]:443 ssl http2;
    
        # For the federation port
        listen 8448 ssl http2 default_server;
        listen [::]:8448 ssl http2 default_server;
    
        server_name matrix.minnix.dev;
    
        location ~* ^(\/_matrix|\/_synapse\/client) {
            proxy_pass http://192.168.57.155:8008;
            proxy_set_header X-Forwarded-For $remote_addr;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header Host $host;
    
            # Nginx by default only allows file uploads up to 1M in size
            # Increase client_max_body_size to match max_upload_size defined in homeserver.yaml
            client_max_body_size 50M;
        }
    
    }    

And for my parent domain-

    server {
    
            server_name minnix.dev;
    
         location /.well-known/matrix/server {
         return 200 '{"m.server": "matrix.minnix.dev:443"}';
         default_type application/json;
         add_header Access-Control-Allow-Origin *;
    
    }
    
         location /.well-known/matrix/client {
         return 200 '{"m.homeserver": {"base_url": "https://matrix.minnix.dev"}}';
         default_type application/json;
         add_header Access-Control-Allow-Origin *;
    
      }
    
    }

I have a feeling this can all be done with a single config as that’s all that’s listed within the official synapse documentation here

For the record I added these lines to the advanced tab to try and enable federation with no change:

listen 8448 ssl http2 default_server;
listen [::]:8448 ssl http2 default_server;

I have transferred 12 other servers over to NPM without issue including Mastodon and Peertube which are federated, but matrix is not working for me.

Nginx Proxy Manager Version v2.9.15

Expected behavior Passing the federation test

Operating System Armbian Focal Ubuntu server running on Rock64

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17

Most upvoted comments

@czadikem @AroPix are you able to share the document and misconfigurations?

(he helped me and it wasnt a fault of npm, rather a misconfigured matrix server)

I do now how to help you I just need to find my document I had.

The problem is that i don’t know how to make the correct settings for it to work in NPM. Do you know how? Would be nice if you could contact me ^^ (discord: removed)

Ok here’s what worked for me:

1.Create a proxy host for matrix.minnix.dev

Domain: matrix.minnix.dev Scheme: http Hostname: 192.168.57.155 Port: 8008

Under the advanced tab:

listen 8448 ssl http2 default_server;
listen [::]:8448 ssl http2 default_server;

Get SSL cert

  1. Create a proxy host for my parent domain minnix.dev

Domain: minnix.dev Scheme: http Hostname: 192.168.57.155 Port: 8008

Under the Advanced tab:

location /.well-known/matrix/server {
     return 200 '{"m.server": "matrix.minnix.dev:443"}';
     default_type application/json;
     add_header Access-Control-Allow-Origin *;

}

     location /.well-known/matrix/client {
     return 200 '{"m.homeserver": {"base_url": "https://matrix.minnix.dev"}}';
     default_type application/json;
     add_header Access-Control-Allow-Origin *;

  }

Get SSL cert