Added TLS docker
testing/ogcore-api/pipeline/head There was a failure building this commit
Details
testing/ogcore-api/pipeline/head There was a failure building this commit
Details
parent
7c90325471
commit
37b21c85a4
|
@ -23,8 +23,10 @@ services:
|
|||
- php
|
||||
ports:
|
||||
- 8080:80
|
||||
- 8443:443 # Añadir el puerto 443
|
||||
volumes:
|
||||
- ./public:/var/www/html/public:cached
|
||||
- ./docker/certs:/etc/nginx/certs # Montar certificados en Nginx
|
||||
networks:
|
||||
- ogcore-network
|
||||
|
||||
|
|
|
@ -1,2 +1,7 @@
|
|||
FROM nginx:latest
|
||||
COPY ./docker/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copiar el archivo de configuración de Nginx
|
||||
COPY ./docker/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copiar los certificados SSL
|
||||
COPY ./docker/certs /etc/nginx/certs
|
||||
|
|
|
@ -1,10 +1,21 @@
|
|||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# Redirigir todo el tráfico HTTP a HTTPS
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name localhost;
|
||||
root /var/www/html/public;
|
||||
index index.html index.php;
|
||||
|
||||
location / {
|
||||
ssl_certificate /etc/nginx/certs/server.crt; # Ruta al certificado
|
||||
ssl_certificate_key /etc/nginx/certs/server.key; # Ruta a la clave
|
||||
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
|
||||
|
@ -13,7 +24,7 @@ server {
|
|||
fastcgi_pass php:9000;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.*)$;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param PATH_INFO $request_uri;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_script_name;
|
||||
}
|
||||
|
||||
|
@ -23,4 +34,4 @@ server {
|
|||
|
||||
error_log /var/log/nginx/error.log;
|
||||
access_log /var/log/nginx/access.log;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Instalar certificados CA de Symfony si no existen
|
||||
if [ ! -f /root/.symfony*/cacert.pem ]; then
|
||||
symfony server:ca:install
|
||||
fi
|
Loading…
Reference in New Issue