From c21f4b3dacd597a15a5ec39d525df1dfe1b70376 Mon Sep 17 00:00:00 2001 From: jdlugosz963 Date: Mon, 17 Jul 2023 01:47:57 +0200 Subject: Add project. --- proxy/Dockerfile | 12 ++++++++++++ proxy/default.conf | 29 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 proxy/Dockerfile create mode 100644 proxy/default.conf (limited to 'proxy') diff --git a/proxy/Dockerfile b/proxy/Dockerfile new file mode 100644 index 0000000..ce56023 --- /dev/null +++ b/proxy/Dockerfile @@ -0,0 +1,12 @@ +FROM nginxinc/nginx-unprivileged:latest +LABEL maintainer="jdlugosz963@gmail.com" + +COPY ./default.conf /etc/nginx/conf.d/default.conf + +USER root + +RUN mkdir -p /vol/static +RUN chmod 755 /vol/static + +USER nginx + diff --git a/proxy/default.conf b/proxy/default.conf new file mode 100644 index 0000000..2e30df3 --- /dev/null +++ b/proxy/default.conf @@ -0,0 +1,29 @@ +upstream app { + server app:8000; +} + +server { + listen 80; + + location /static { + alias /vol/web/static; + } + + location / { + try_files $uri @proxy_to_app; + } + + location @proxy_to_app { + proxy_pass http://app; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Host $server_name; + } +} \ No newline at end of file -- cgit v1.2.3