Skip to content

Commit de555dd

Browse files
committed
6601: Updated nginx configuration
1 parent d5f42fb commit de555dd

2 files changed

Lines changed: 9 additions & 12 deletions

File tree

infrastructure/display-api-service/Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
################################
2-
# Assets build
2+
# Assets build
33
################################
44
FROM --platform=$BUILDPLATFORM node:24-alpine AS assets_builder
55
LABEL maintainer="ITK Dev <itkdev@mkb.aarhus.dk>"
@@ -45,7 +45,7 @@ RUN rm -rf package* vite.config.js
4545

4646

4747
################################
48-
# PHP-FPM (API) production image
48+
# PHP-FPM (API) production image
4949
################################
5050
FROM --platform=$BUILDPLATFORM itkdev/php8.4-fpm:alpine
5151
LABEL maintainer="ITK Dev <itkdev@mkb.aarhus.dk>"
@@ -65,6 +65,9 @@ ENV APP_ENV=prod \
6565

6666
# Install the api application.
6767
COPY --chown=deploy:deploy --from=api_app_builder /app .
68-
RUN mkdir -p ./config/secrets
68+
69+
# Symfony settings (warmup required to make vite assets work corretly)
70+
RUN mkdir -p ./config/secrets \
71+
bin/console cache:warmup
6972

7073
CMD [ "docker-entrypoint.sh" ]

infrastructure/nginx/etc/templates/default.conf.template

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
upstream api_backend {
2-
server ${NGINX_FPM_SERVICE};
3-
keepalive 16;
4-
}
5-
61
server {
72
listen ${NGINX_PORT};
83
listen [::]:${NGINX_PORT};
@@ -27,7 +22,7 @@ server {
2722
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
2823

2924
# Real IP from reverse proxy
30-
set_real_ip_from ${NGINX_SET_REAL_IP_FROM};
25+
set_real_ip_from ${NGINX_SET_REAL_IP_FROM:-172.16.0.0/16};
3126
real_ip_recursive on;
3227
real_ip_header X-Forwarded-For;
3328

@@ -63,7 +58,7 @@ server {
6358

6459
# Screen client online check should just serve static files
6560
location /client/online-check {
66-
index index.html index.htm;
61+
index index.html;
6762
}
6863

6964
location = /robots.txt {
@@ -98,7 +93,7 @@ server {
9893

9994
# PHP-FPM handling
10095
location ~ ^/index\.php(/|$) {
101-
fastcgi_pass api_backend;
96+
fastcgi_pass ${NGINX_FPM_SERVICE}:${NGINX_FPM_PORT};
10297
fastcgi_split_path_info ^(.+\.php)(/.*)$;
10398
include fastcgi_params;
10499

@@ -126,7 +121,6 @@ server {
126121
return 404;
127122
}
128123

129-
# Send log message to files symlinked to stdout/stderr.
130124
sendfile on;
131125
keepalive_timeout 65;
132126

0 commit comments

Comments
 (0)