spantaleev / matrix-docker-ansible-deploy

🐳 Matrix (An open network for secure, decentralized communication) server setup using Ansible and Docker
GNU Affero General Public License v3.0
4.92k stars 1.05k forks source link

Nginx Proxy IPv6 error 404 #1817

Open TomBraun02 opened 2 years ago

TomBraun02 commented 2 years ago

Describe the bug Own external Nginx proxy running with IPv4 and IPv6..

To Reproduce Send Whatsapp Messeg to other Whatsapp user

matrix_domain: test.me
matrix_homeserver_implementation: synapse
matrix_homeserver_generic_secret_key: "xxxxxxxxxxx"
matrix_synapse_federation_enabled: true
matrix_ssl_lets_encrypt_support_email: 'matrix@test.me'
matrix_postgres_connection_password: xxxxxxxxxxxxxxx
matrix_nginx_proxy_enabled: false
matrix_ssl_retrieval_method: none
matrix_mautrix_whatsapp_enabled: true

Don't work 404 2a02:3030:808:d10d:44c:2a4c:10d2:60d - - [11/May/2022:22:10:55 +0200] "PUT /_matrix/client/r0/rooms/!JvjIAAAiapcRBAKJey:eller.me/send/m.room.message/kMXEventLocalId_7D580D15-6132-4594-B90C-A6112EA3A382-29462-000004F02A7757E4 HTTP/1.1" 404 261 "-" "Riot/1.8.14 (iPhone; iOS 15.4.1; Scale/3.00)"

Work 200 79.223.199.61 - - [11/May/2022:22:12:36 +0200] "PUT /_matrix/client/r0/rooms/!JvjIAAAiapcRBAKJey:eller.me/send/m.room.message/kMXEventLocalId_7D580D15-6132-4594-B90C-A6112EA3A382-29462-000004F02A7757E4 HTTP/1.1" 200 90 "-" "Riot/1.8.14 (iPhone; iOS 15.4.1; Scale/3.00)"

Matrix Server:

matrix.conf
server {
    server_name matrix.test.me;

    server_tokens off;
    root /dev/null;
    gzip on;
    gzip_types text/plain application/json;
    add_header Permissions-Policy interest-cohort=() always;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-XSS-Protection "1; mode=block";
    location /.well-known/matrix {
        root /matrix/static-files;
        expires 4h;
        default_type application/json;
        add_header Access-Control-Allow-Origin *;
    }
    location ^~ /_matrix/identity {
        proxy_pass http://127.0.0.1:8090;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
    location ^~ /_matrix/client/r0/user_directory/search {
        proxy_pass http://127.0.0.1:8090;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
    }
    location /042bbbb-1949-bbbb-bbbb-7179ffbcbbbb {
        proxy_pass http://127.0.0.1:9006;
     }
    location ~* ^(/_matrix|/_synapse/client) {
        proxy_pass http://127.0.0.1:12080;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        client_body_buffer_size 25M;
        client_max_body_size 50M;
        proxy_max_temp_file_size 0;
    }
    location ~* ^/$ {
        return 302 $scheme://element.test.me$request_uri;
    }
}
server {
    listen 8448 ssl http2;
    listen [::]:8448 ssl http2;
    server_name matrix.test.me;
    server_tokens off;
    root /dev/null;
    gzip on;
    gzip_types text/plain application/json;
    location / {
        proxy_pass http://127.0.0.1:12088;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $remote_addr;
        proxy_set_header X-Forwarded-Proto $scheme;
        client_body_buffer_size 25M;
        client_max_body_size 150M;
        proxy_max_temp_file_size 0;
    }
    ssl_certificate /etc/letsencrypt/live/test.me/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/test.me/privkey.pem;
    include /etc/letsencrypt/options-ssl-nginx.conf;
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
}
server {
    if ($host = matrix.test.me) {
        return 301 https://$host$request_uri;
        listen 80;
        listen [::]:80;
        server_name matrix.test.me;
}
matrix-synapse.conf:
server {
        listen 12080;
        server_tokens off;
        root /dev/null;
        gzip on;
        gzip_types text/plain application/json;
        location / {
                        proxy_pass http://127.0.0.1:8008;

                proxy_set_header Host $host;

                client_body_buffer_size 25M;
                client_max_body_size 50M;
                proxy_max_temp_file_size 0;
        }
}
server {
        listen 12088;
        server_tokens off;
        root /dev/null;
        gzip on;
        gzip_types text/plain application/json;
        location / {
                        proxy_pass http://127.0.0.1:8048;
                proxy_set_header Host $host;
                client_body_buffer_size 25M;
                client_max_body_size 150M;
                proxy_max_temp_file_size 0;
        }
}
JokerGermany commented 2 years ago

Hello, at the moment i am looking in a similar problem. #1914 Can you pls look into the directory /matrix/nginx-proxy/conf.d/ and upload every file which has proxy_pass http://localhost or something like that in it?