Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Nginx proxy confuguration in install docs is not working ( regex issue) #9155

Closed
waleedsaud opened this issue Jan 19, 2021 · 7 comments
Closed

Comments

@waleedsaud
Copy link

waleedsaud commented Jan 19, 2021

Description

Steps to reproduce

Nginx can't find the url part specified by this regex location ~* ^(\/_matrix|\/_synapse\/client) .

@clokep
Copy link
Member

clokep commented Jan 19, 2021

This was updated in #8227, maybe that had a bug. You should be able to do the same thing by specifying both /_matrix and /_synapse/client as locations with the same config.

I'd suggest asking in #synapse:matrix.org to see if anyone has thoughts.

@waleedsaud
Copy link
Author

Thank you very much it is solved based 8227 and sorry for opening the ticket in the wrong repository .

@clokep
Copy link
Member

clokep commented Jan 19, 2021

@waleedsaud This is the correct repository. Can you describe a bit more about how you fixed this? I'm curious if there's a bug in our documentation!

@waleedsaud
Copy link
Author

I used the / instead on the whole regex .
thank you again for the work you did in matrix it is very good to work with.

@seth586
Copy link

seth586 commented Feb 15, 2021

I used the / instead on the whole regex .
thank you again for the work you did in matrix it is very good to work with.

Can you post the whole nginx location {} block you are using that works? I suck at regex :)

This should still be an open issue, as the nginx config at https://github.com/matrix-org/synapse/blob/develop/docs/reverse_proxy.md#nginx does not properly proxy.

Thank you!

@waleedsaud
Copy link
Author

waleedsaud commented Feb 21, 2021

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    # For the federation port
    listen 8448 ssl default_server;
    listen [::]:8448 ssl default_server;

    include snippets/self-signed.conf;
    server_name notify.com;

    location / {
        proxy_pass http://127.0.0.1:8008;
        proxy_set_header X-Forwarded-For $remote_addr;
        # 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;
    }
}

@seth586
Copy link

seth586 commented Sep 18, 2021

The fix above exposes /_synapse/admin, I found a fix for the regex:

location ~ ^/(_matrix|_synapse/client)/ {
        proxy_pass http://127.0.0.1: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;
    }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants