Fix #6 using nginx

This commit is contained in:
Marc Ducobu
2021-07-01 14:47:23 +02:00
parent 777464d788
commit 0ddfe09ab8
5 changed files with 51 additions and 579 deletions

2
nginx/Dockerfile Normal file
View File

@@ -0,0 +1,2 @@
FROM nginx
COPY ./default.conf /etc/nginx/conf.d/default.conf

39
nginx/default.conf Normal file
View File

@@ -0,0 +1,39 @@
server {
listen 80;
listen [::]:80;
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
location / {
proxy_pass http://citizen-front:4000/;
}
location /api/ {
proxy_pass http://citizen-back:5002/api/;
}
location /api/media/ {
proxy_pass http://citizen-back:5002/api/media/;
proxy_intercept_errors on;
error_page 404 = @media1;
}
location /api/media1/ {
proxy_pass http://media/;
}
location @media1 {
rewrite ^/api/media/(.*)$ /api/media1/$1;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}