UP-NextPush / server-app

UnifiedPush provider for Nextcloud - server application - Moved to https://codeberg.org/NextPush/uppush
GNU Affero General Public License v3.0
67 stars 8 forks source link

Use the matrix gateway with nginx fastcgi #9

Closed th0mcat closed 2 years ago

th0mcat commented 2 years ago

I'm currently unable to use the matrix gateway with my current setup.

Nextcloud -> Installed directly on host, /opt/nextcloud, using default nginx config file which has

upstream php-handler {
    server 127.0.0.1:9000;
    #server unix:/var/run/php/php7.4-fpm.sock;
}

Accessing https://nextcloud.blah/index.php/apps/uppush/gateway/matrix works just fine.

image

php7.4-fpm -> is listening on 127.0.0.1:9000, is set in /etc/php/7.4/fpm/pool.d/www.conf.

...
listen = 127.0.0.1:9000

matrix-synapse -> Running in a docker container. Below is the current NextPush nginx entry for synapse:

# Nextcloud UnifiedPush App
    location /_matrix/push/v1/notify {
        proxy_pass http://127.0.0.1:9000/index.php/apps/uppush/gateway/matrix;
        proxy_buffering off;
        proxy_connect_timeout   10m;
        proxy_send_timeout      10m;
        proxy_read_timeout      10m;
    }

Current nginx error message:

2022/03/22 15:48:31 [error] 3634369#3634369: *742 upstream timed out (110: Connection timed out) while reading upstream, client: 192.168.1.35, server: nextcloud.blah, request: "GET /index.php/apps/uppush/device/<key> HTTP/2.0", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.blah"

When trying to access https://thomcat.rocks/_matrix/push/v1/notify:

image

th0mcat commented 2 years ago

The following location block worked for me:

    location /_matrix/push/v1/notify {
        proxy_pass https://nextcloud.blah/index.php/apps/uppush/gateway/matrix;
        proxy_buffering off;
        proxy_connect_timeout   10m;
        proxy_send_timeout      10m;
        proxy_read_timeout      10m;
    }