Fix #6 using nginx
This commit is contained in:
2
nginx/Dockerfile
Normal file
2
nginx/Dockerfile
Normal file
@@ -0,0 +1,2 @@
|
||||
FROM nginx
|
||||
COPY ./default.conf /etc/nginx/conf.d/default.conf
|
39
nginx/default.conf
Normal file
39
nginx/default.conf
Normal 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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user