diff --git a/.env b/.env index cf8e039e..51f8de14 100644 --- a/.env +++ b/.env @@ -18,7 +18,7 @@ TIME_ZONE=Europe/Brussels NGINX_VERSION=1.23.3 NGINX_PORT_WEB=80 NGINX_PORT_SSL=443 -NGINX_SITES_ENABLED=webclient +NGINX_SITES_ENABLED= ################################################################################ # webclient # diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 078d09cc..20204d81 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -1,49 +1,56 @@ -error_log /var/log/nginx/error.log; -pid /var/run/nginx.pid; - -events { - worker_connections 1024; -} - -http { - server_tokens off; - - sendfile on; - tcp_nopush on; - tcp_nodelay on; - - client_body_timeout 120; - client_header_timeout 120; - keepalive_timeout 600; - send_timeout 120; - - types_hash_max_size 4096; - - client_body_buffer_size 30K; - client_header_buffer_size 10k; - client_max_body_size 50m; - large_client_header_buffers 2 10k; - - fastcgi_send_timeout 600; - fastcgi_read_timeout 600; - proxy_connect_timeout 600; - proxy_send_timeout 600; - proxy_read_timeout 600; - - open_file_cache max=2000 inactive=20s; - open_file_cache_valid 60s; - open_file_cache_min_uses 2; - open_file_cache_errors off; - - include /etc/nginx/mime.types; - default_type application/octet-stream; - - access_log on; - error_log on; - - gzip on; - gzip_disable "msie6"; - - include /etc/nginx/conf.d/*.conf; - include /etc/nginx/sites-enabled/*; -} +server_names_hash_bucket_size 64; + +server { + listen 80 default_server; + listen [::]:80 default_server; + server_name _; + + sendfile on; + tcp_nodelay on; + tcp_nopush on; + server_tokens off; + types_hash_max_size 4096; + + client_body_buffer_size 30K; + client_header_buffer_size 10k; + client_max_body_size 50m; + large_client_header_buffers 2 10k; + + client_body_timeout 120; + client_header_timeout 120; + keepalive_timeout 600; + send_timeout 120; + + fastcgi_send_timeout 600; + fastcgi_read_timeout 600; + proxy_connect_timeout 600; + proxy_send_timeout 600; + proxy_read_timeout 600; + + open_file_cache max=2000 inactive=20s; + open_file_cache_valid 60s; + open_file_cache_min_uses 2; + open_file_cache_errors off; + + location /API/ { + set $backend http://backend:8000; + resolver 127.0.0.11 valid=30s; + proxy_pass $backend; + } + + location / { + set $webclient http://webclient:80; + resolver 127.0.0.11 valid=30s; + proxy_pass $webclient; + } + + location /static/ { + set $filestorage http://filestorage:8080; + resolver 127.0.0.11 valid=30s; + proxy_pass $filestorage; + + autoindex on; # Enable directory listing + autoindex_format json; # Use JSON format for listing (optional) + index index.html; # Specify the custom index file + } +} \ No newline at end of file