{"id":61,"date":"2026-09-24T11:18:56","date_gmt":"2026-09-24T11:18:56","guid":{"rendered":"https:\/\/danielsh.es\/index.php\/2026\/09\/24\/nginx-reverse-proxy-ssl-docker-compose\/"},"modified":"2026-09-24T11:18:56","modified_gmt":"2026-09-24T11:18:56","slug":"nginx-reverse-proxy-ssl-docker-compose","status":"publish","type":"post","link":"https:\/\/danielsh.es\/index.php\/2026\/09\/24\/nginx-reverse-proxy-ssl-docker-compose\/","title":{"rendered":"Nginx Reverse Proxy con SSL y Docker Compose"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\" style=\"font-size:1.15rem;line-height:1.7\">Un proxy inverso es una pieza clave en cualquier infraestructura de servidores: permite centralizar la terminaci\u00f3n SSL, ocultar las IPs de los servicios internos y balancear la carga.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">1. Archivo docker-compose.yml<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>version: '3.8'\n\nservices:\n  nginx-proxy:\n    image: nginx:alpine\n    container_name: nginx-proxy\n    restart: unless-stopped\n    ports:\n      - \"80:80\"\n      - \"443:443\"\n    volumes:\n      - .\/nginx.conf:\/etc\/nginx\/nginx.conf:ro\n      - .\/conf.d:\/etc\/nginx\/conf.d:ro\n      - .\/certs:\/etc\/nginx\/certs:ro\n    networks:\n      - proxy-net\n\nnetworks:\n  proxy-net:\n    external: true<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">2. Configuraci\u00f3n de VirtualHost con Proxy Pass<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>server {\n    listen 80;\n    server_name servicio.danielsh.es;\n    return 301 https:\/\/$host$request_uri;\n}\n\nserver {\n    listen 443 ssl http2;\n    server_name servicio.danielsh.es;\n\n    ssl_certificate \/etc\/nginx\/certs\/fullchain.pem;\n    ssl_certificate_key \/etc\/nginx\/certs\/privkey.pem;\n\n    location \/ {\n        proxy_pass http:\/\/contenedor_servicio:8080;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n}<\/code><\/pre>\n\n","protected":false},"excerpt":{"rendered":"<p>Un proxy inverso es una pieza clave en cualquier infraestructura de servidores: permite centralizar la terminaci\u00f3n SSL, ocultar las IPs de los servicios internos y balancear la carga. 1. Archivo docker-compose.yml 2. Configuraci\u00f3n de VirtualHost con Proxy Pass<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,4,2],"tags":[],"class_list":["post-61","post","type-post","status-publish","format-standard","hentry","category-apuntes-asir","category-linux-sysadmin","category-servidores-homelab"],"_links":{"self":[{"href":"https:\/\/danielsh.es\/index.php\/wp-json\/wp\/v2\/posts\/61","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/danielsh.es\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/danielsh.es\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/danielsh.es\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/danielsh.es\/index.php\/wp-json\/wp\/v2\/comments?post=61"}],"version-history":[{"count":0,"href":"https:\/\/danielsh.es\/index.php\/wp-json\/wp\/v2\/posts\/61\/revisions"}],"wp:attachment":[{"href":"https:\/\/danielsh.es\/index.php\/wp-json\/wp\/v2\/media?parent=61"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/danielsh.es\/index.php\/wp-json\/wp\/v2\/categories?post=61"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/danielsh.es\/index.php\/wp-json\/wp\/v2\/tags?post=61"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}