Problem with Proxy/SSL

I deployed app consisting of nextjs and strapi on Ubuntu 20.4 VPS with nginx and postgres.
Since i added ssl certificate via cert bot, now very time i log in, admin panel seems to be in infinite “loop” of loading (like it he picture).
There is no errors so im guessing its a matter of bad proxy config

Next js app is working on port :3000 and Strapi is working on :3002

Looking for some guidance how i can fix that.

Thanks!

Here is current nginx config:

server {
server_name [temporary removed names];
location / {
proxy_pass http://127.0.0.1:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection ‘upgrade’;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /admin/ {
proxy_pass http://127.0.0.1:3002;

}

listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/ [temporary removed names]/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/ [temporary removed names]/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

}

server {
if ($host = [temporary removed names] {
return 301 https://$host$request_uri;
} # managed by Certbot

if ($host = [temporary removed names]) {
    return 301 https://$host$request_uri;
} # managed by Certbot

listen 80;
server_name [temporary removed names];
return 404; # managed by Certbot

}

This topic has been created from a Discord post (1216900924740730920) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord