Ipv6 misconfig lead to 400 bad request

Heyllo again :slight_smile:

So I’ve being have network issue since my upgrade to bullseye : 400 bad request on the web interface. I’ve resolve the issue by setting the ipv6 dns. But my router (freebox revolution) seem to change or unassign the global ipv6 adress. So I would like to be hable to count only on ipv4. The problem is that without ipv6 I have this bad request error and I can’t figure out where its coming from.

Any ideas ?

actually maybe its not the router fault : Arch Linux ARM • View topic - IPv6 addresses randomly vanish

But the question is the same : why yunohost or debian would not work without ipv6 after the upgrade ? oO

another thing is that I have the 400 bad request error when I try to reach the server with my android phone, but its not happening in my computer…
Maybe Android don’t use ipv6 ?

some logs :
yunhost nginx show clearly thery no issuein ipv6 but the is in ipv4 :

2a01:e34:ec6f:6aa0:3558:41d9:fb34:c9a - - [16/Nov/2022:09:50:54 +0100] "GET /yunohost/sso/assets/icons/favicon-32x32.png HTTP/2.0" 200 906 "https://gafamfree.party/yunohost/sso/?r=aHR0cHM6Ly9nYWZhbWZyZWUucGFydHkv" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:107.0) Gecko/20100101 Firefox/107.0"
192.168.0.3 - - [16/Nov/2022:09:51:12 +0100] "GET /nextcloud/ocs/v2.php/cloud/user?format=json HTTP/1.0" 400 150 "-" "-

the reverse proxy conf :

server {
    listen          443 ssl;
#    listen [::]:443 ssl;
    server_namex xxxxx;
location /{
       proxy_pass             https://192.168.0.88:443/;
       proxy_redirect          off;
       proxy_set_header        Host            $http_host:443;
       proxy_set_header        Host            $host;
       proxy_set_header        X-Real-IP       $remote_addr;
       proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header        X-Forwarded-Proto $scheme;
       proxy_set_header        X-Url-Scheme $scheme;
       proxy_buffering off; 
   }

location = /YJswQRil80YOd9yIo4pW1vFf {
    stub_status;
}

error_log /var/log/nginx/xxxx_error.log;
access_log /var/log/nginx/xxxx_access.log;

ssl_certificate     /etc/letsencrypt/live/xxxx/fullchain.pem;
ssl_certificate_key  /etc/letsencrypt/live/xxxx/privkey.pem;

ssl_session_timeout 5m;
ssl_session_cache shared:SSL:50m;
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ALL:!aNULL:!eNULL:!LOW:!EXP:!RC4:!3DES:+HIGH:+MEDIUM;
#add_header Strict-Transport-Security "max-age=31536000;";


}

server {
    listen 80;
    listen          [::]:80;
    server_name xxxxx;
    location /{
               rewrite  ^/(.*)$  https://xxxxx/$1  permanent;
    }
}

if I bypass the reverse proxy and ask the router to connect yunohost directly to internet the URL is redirecto to the local ip adress but ony with ipv4 request… Ipv6 adress works
I launched yunohost tools regen-conf nginx to be shure the nginx conf was alright

didn’t change anythin by now its working…whaaat ^^’

so the reverse proxy seemed to be the problem (if nothing is cached anywhere)

I add to comment out :

#       proxy_set_header        Host            $host;
#       proxy_set_header        X-Real-IP       $remote_addr;
#       proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
#       proxy_set_header        X-Forwarded-Proto $scheme;
#       proxy_set_header        X-Url-Scheme $scheme;