diff --git a/docker-compose.yml b/docker-compose.yml index dbe1247..30a1dc3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,9 +14,9 @@ services: volumes: - ./web:/var/www - node_modules:/var/www/node_modules - - ./etc/ssl:/etc/ssl - - ./etc/nginx:/etc/nginx/conf.d - - ./etc/nginx/log/:/var/log/nginx + - ./web/etc/ssl:/etc/ssl + - ./web/etc/nginx/conf.d:/etc/nginx/conf.d + - ./web/etc/nginx/log:/var/log/nginx api: build: context: ./api diff --git a/web/etc/nginx/default.conf b/etc/nginx/default.conf/default.conf similarity index 99% rename from web/etc/nginx/default.conf rename to etc/nginx/default.conf/default.conf index 469cac1..55e5303 100644 --- a/web/etc/nginx/default.conf +++ b/etc/nginx/default.conf/default.conf @@ -42,4 +42,4 @@ server { location = /50x.html { root /usr/share/nginx/html; } -} \ No newline at end of file +} diff --git a/web/etc/nginx/conf.d/default.conf b/web/etc/nginx/conf.d/default.conf new file mode 100644 index 0000000..40dde7d --- /dev/null +++ b/web/etc/nginx/conf.d/default.conf @@ -0,0 +1,49 @@ +server { + listen 443 ssl; + server_name localhost; + + # Path to SSL certificate and key + ssl_certificate /etc/ssl/certs/localhost.cer; + ssl_certificate_key /etc/ssl/private/localhost.key; + + # Root directory for the Angular app + root /usr/share/nginx/html; + + # Default file to serve + index index.html; + + # Serve static files from /usr/share/nginx/html + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + # Error pages + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # Optional: Gzip compression for improved performance + gzip on; + gzip_types text/plain application/javascript text/css application/json application/xml text/javascript; + gzip_min_length 1024; +} + + +server { + listen 80; + server_name localhost; + + # Serve static files from /usr/share/nginx/html + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + # Error pages + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} \ No newline at end of file