Password App keep throwing 502 errors

(Newbie question) I have nextcloud installed on Ubuntu 20.04 via snap. I can’t access Passwords app anymore it keeps throwing 502 error. I am not sure how can I get access to logs which can help with debugging the issue. I will really appreciate any help or guidance.

From Network tab of browser i can see

both are failing with 502.

Check the logs like described here: App Debugging · Wiki · nextcloud / passwords · GitLab

I found single line in settings > logging which says “Attempt to access expired or nonexistent session”.

That’s not really something that sounds like it would cause this issue.

502 is often a timeout error, so Nextcloud does not answer within the required timeframe.
You should check if there is something going on with the bruteforce detection, if headers are transferred correctly to Nextcloud or if there is some kind of firewall blocking the request.

I have a reverse proxy setup, could that be causing this issue? but why on these two API calls?

server {
    listen 80;
    return         301 https://$server_name$request_uri;
#server block 2
server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;
#    ssl on;
    #ssl_protocols TLSv1.2;
    ssl_protocols       TLSv1.2 TLSv1.3;
    #ssl_ciphers         HIGH:!aNULL:!MD5;
    ssl_certificate /etc/letsencrypt/live/;
    ssl_certificate_key /etc/letsencrypt/live/;
    ssl_trusted_certificate /etc/letsencrypt/live/;
    ssl_session_timeout 1d;
    ssl_session_cache shared:SSL:50m;
    ssl_session_tickets off;
    ssl_prefer_server_ciphers on;
    ssl_dhparam /etc/letsencrypt/certs/dhparam.pem;

    # HSTS (ngx_http_headers_module is required) (15768000 seconds = 6 months)
    add_header Strict-Transport-Security max-age=15768000;

    # OCSP Stapling ---
    # fetch OCSP records from URL in ssl_certificate and cache them
    ssl_stapling on;
    ssl_stapling_verify on;
    resolver valid=300s;

    gzip on;
    gzip_http_version 1.1;
    gzip_vary on;
    gzip_comp_level 6;
    gzip_min_length 1000;
    gzip_proxied    expired no-cache no-store private auth;
    gzip_types text/plain text/xml application/xml text/css application/css application/x-javascript application/javascript;

    client_max_body_size 2000M;
          location / {
          proxy_buffers 16 4k;
          proxy_buffer_size 2k;
          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_pass https://internal-ip:internal-port;


I really apperciate your help.

When i look at my proxy setup, i see that i also forward the authorization header. that might be the issue:

        proxy_set_header  Authorization     $http_authorization;
        proxy_pass_header Authorization;

I added these lines, but still getting 502 on the requests I mentioned.

where does this message come from Attempt to access expired or nonexistent session <SESSION_ID> by USERNAME.