diff --git a/Dockerfile b/Dockerfile index 553c431..6a4571b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,6 +11,7 @@ RUN npm run build FROM nginx:stable-alpine as production-stage COPY --from=build-stage /app/dist /app/eo-services COPY nginx.conf /etc/nginx/nginx.conf +COPY default.conf.template /etc/nginx/templates/default.conf.template COPY headers.js /etc/nginx/headers.js EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/default.conf.template b/default.conf.template new file mode 100644 index 0000000..62e40a3 --- /dev/null +++ b/default.conf.template @@ -0,0 +1,23 @@ +server { + listen 80; + server_name localhost; + + location /eo-services { + mirror /mirror; + root /app; + index index.html; + try_files $uri $uri/ /eo-services/index.html; + add_header Cache-Control 'no-store'; + } + + location /mirror { + internal; + proxy_pass ${AUTH_PROXY_PASS}; + proxy_set_header X-Original-URI $request_uri; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +} \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 89eab2b..6555752 100644 --- a/nginx.conf +++ b/nginx.conf @@ -28,27 +28,4 @@ http { access_log /var/log/nginx/access.log main; sendfile on; keepalive_timeout 65; - server { - listen 80; - server_name localhost; - - location /eo-services { - mirror /mirror; - root /app; - index index.html; - try_files $uri $uri/ /eo-services/index.html; - add_header Cache-Control 'no-store'; - } - - location /mirror { - internal; - proxy_pass https://eo-services.mortons.site/api/auth; - proxy_set_header X-Original-URI $request_uri; - } - - error_page 500 502 503 504 /50x.html; - location = /50x.html { - root /usr/share/nginx/html; - } - } } \ No newline at end of file