diff --git a/compose.yaml b/compose.yaml index 84b1318..6e20b15 100644 --- a/compose.yaml +++ b/compose.yaml @@ -82,11 +82,20 @@ services: - backend nginx: + build: + context: . + target: nginx + args: + EGEYA_VERSION: ${EGEYA_VERSION:-4199} + EGEYA_URL: ${EGEYA_URL:-} + EGEYA_SHA256: ${EGEYA_SHA256:-} + image: ${EGEYA_NGINX_IMAGE:-local/egeya-nginx}:${EGEYA_VERSION:-4199} restart: unless-stopped depends_on: - - php + php: + condition: service_healthy environment: NGINX_SERVER_NAME: ${NGINX_SERVER_NAME:-_} @@ -97,7 +106,8 @@ services: - "${HTTP_BIND:-127.0.0.1}:${HTTP_PORT:-8080}:80" volumes: - - ./nginx/egeya.conf.template:/etc/nginx/templates/egeya.conf.template:ro + - ./data:/var/www/egeya-data:ro + - ./docker/nginx/egeya.conf.template:/etc/nginx/templates/egeya.conf.template:ro networks: - frontend diff --git a/docker/nginx/egeya.conf.template b/docker/nginx/egeya.conf.template index 87f3845..10485f4 100644 --- a/docker/nginx/egeya.conf.template +++ b/docker/nginx/egeya.conf.template @@ -7,6 +7,9 @@ server { keepalive_timeout 70; client_max_body_size ${NGINX_CLIENT_MAX_BODY_SIZE}; + absolute_redirect off; + port_in_redirect off; + root /var/www/html; index index.php index.html; @@ -42,9 +45,12 @@ server { fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - fastcgi_param HTTP_HOST $http_host; + fastcgi_param HTTP_HOST $host:${NGINX_EXTERNAL_PORT}; fastcgi_param SERVER_NAME $host; fastcgi_param SERVER_PORT ${NGINX_EXTERNAL_PORT}; + fastcgi_param HTTP_X_FORWARDED_HOST $host; + fastcgi_param HTTP_X_FORWARDED_PORT ${NGINX_EXTERNAL_PORT}; + fastcgi_param HTTP_X_FORWARDED_PROTO $scheme; fastcgi_param E2_SYNTH_URLS true; @@ -59,4 +65,4 @@ server { location ~ \.psa$ { deny all; } -} \ No newline at end of file +}