summaryrefslogtreecommitdiffstats
path: root/proxy
diff options
context:
space:
mode:
Diffstat (limited to 'proxy')
-rw-r--r--proxy/Dockerfile12
-rw-r--r--proxy/default.conf29
2 files changed, 41 insertions, 0 deletions
diff --git a/proxy/Dockerfile b/proxy/Dockerfile
new file mode 100644
index 0000000..ce56023
--- /dev/null
+++ b/proxy/Dockerfile
@@ -0,0 +1,12 @@
1FROM nginxinc/nginx-unprivileged:latest
2LABEL maintainer="jdlugosz963@gmail.com"
3
4COPY ./default.conf /etc/nginx/conf.d/default.conf
5
6USER root
7
8RUN mkdir -p /vol/static
9RUN chmod 755 /vol/static
10
11USER nginx
12
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 @@
1upstream app {
2 server app:8000;
3}
4
5server {
6 listen 80;
7
8 location /static {
9 alias /vol/web/static;
10 }
11
12 location / {
13 try_files $uri @proxy_to_app;
14 }
15
16 location @proxy_to_app {
17 proxy_pass http://app;
18
19 proxy_http_version 1.1;
20 proxy_set_header Upgrade $http_upgrade;
21 proxy_set_header Connection "upgrade";
22
23 proxy_redirect off;
24 proxy_set_header Host $host;
25 proxy_set_header X-Real-IP $remote_addr;
26 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
27 proxy_set_header X-Forwarded-Host $server_name;
28 }
29} \ No newline at end of file