Yo uso un servidor proxy inverso nginx. He creado un dominio + certificado tls vamos a cifrar. Cuando configuro un proxy inverso con un certificado, la instalación es muy especial. Vea las siguientes imágenes. https://imgur.com/a/AnF0plk
Archivo de configuración con certificado tls
server {
server_name my-domain.abc.com;
return 301 http://www.my-domain.abc.com$request_uri;
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/my-domain.abc.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/my-domain.abc.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 {
server_name www.my-domain.abc.com;
location / {
proxy_pass http://192.168.1.101;
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;
}
listen 443 ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/my-domain.abc.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/my-domain.abc.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 = my-domain.abc.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name my-domain.abc.com;
return 404; # managed by Certbot
}
server {
if ($host = www.my-domain.abc.com) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name www.my-domain.abc.com;
return 404; # managed by Certbot
}
Cuando configuro un archivo de configuración sin un certificado tls (solo http), todo funciona normalmente.
server {
listen 80;
server_name my-domain.abc.com;
return 301 http://www.my-domain.abc.com$request_uri;
}
server {
listen 80;
server_name www.my-domain.abc.com;
location / {
proxy_pass http://192.168.1.101;
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;
}
}
no se donde esta el error
Este tema fue modificado hace 10 meses, 1 semana por
.