How to perform proxy_pass on two HestiaCP servers

good evening, how can I perform a proxy_pass between two Hestia servers, my first server receives public ip, through Nat (10.10.20.100) in my firewall, so far everything is fine, my main domain domain.tld serves correctly, but I have a second server (10.10.20.200) HestiaCP and when performing the proxi_pass the browsers show “too many redirects”, it should be mentioned that I have a third server on 10.10.20.150 that only has LAMP and works perfectly with having modified the tpl and stpl, then I show code in location /

.tpl

server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;

include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
location / {
    return 301 https://%domain_idn%/;
}

location /error/ {
    alias   %home%/%user%/web/%domain%/document_errors/;
}

}

and .stpl
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
#ssl_stapling on;
#ssl_stapling_verify on;
error_log /var/log/%web_system%/domains/%domain%.error.log error;

include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;

include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;

location / {

    proxy_pass http://10.10.20.150;

    #Proxy Headers
    proxy_redirect                  off;
    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 timeouts
}

}

as I mentioned this code works perfect for me for LAMP(10.10.20.150), but for the second HestiaCP(10.10.20.200) server, it gives me the error “too many redirects” What ngixs directive am I missing?

I mention that they are two different files, :stuck_out_tongue: proxy_lamp and proxy_second_HestiaCP .tpl and .stpl

Change to https:// or disable ssl on the second server…