diff --git a/deploy/Dockerfile.nginx b/deploy/Dockerfile.nginx index 99a254e..bb4717e 100644 --- a/deploy/Dockerfile.nginx +++ b/deploy/Dockerfile.nginx @@ -1,2 +1,3 @@ FROM nginx:alpine COPY www /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf diff --git a/deploy/nginx.conf b/deploy/nginx.conf new file mode 100644 index 0000000..6586265 --- /dev/null +++ b/deploy/nginx.conf @@ -0,0 +1,19 @@ +server { + listen 80; + server_name _; + + root /usr/share/nginx/html; + index index.html; + + location /api/ { + proxy_pass http://backend:3000/api/; + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } + + location / { + try_files $uri $uri/ /index.html; + } +}