summaryrefslogtreecommitdiffstats
path: root/proxy
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2023-07-17 01:47:57 +0200
committerjdlugosz963 <jdlugosz963@gmail.com>2023-07-17 01:52:26 +0200
commitc21f4b3dacd597a15a5ec39d525df1dfe1b70376 (patch)
tree0dfc51d2ffeb7b5022d9ad852f2fd3620c72196a /proxy
parent2c6f98aeef4fa1aba5678fe17c8e762a11db7b40 (diff)
downloadrestaurant-orders-c21f4b3dacd597a15a5ec39d525df1dfe1b70376.tar.gz
restaurant-orders-c21f4b3dacd597a15a5ec39d525df1dfe1b70376.zip
Add project.main
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