Trying to redirecting ip(boxip)to port. Getting this error. Using nginx

Getting this error: The page isn’t redirecting properly

An error occurred during a connection to hidden.

This problem can sometimes be caused by disabling or refusing to accept cookies.

server {
    server_name bot.hidden.com;
    location / {
        proxy_set_header Host $host;
        proxy_pass http://bot.hidden.com:1235;
        proxy_redirect off;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/bot.hidden.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/bot.hidden.com/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 = bot.hidden.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot


    listen 80;
    server_name bot.hidden.com;
    return 404; # managed by Certbot


}