Split nginx config; added start of gateway routing
parent
1d14f39642
commit
7e09e6879c
|
@ -17,8 +17,9 @@ RUN yarn run build
|
|||
FROM nginx:1.21.4-alpine
|
||||
|
||||
# Copy over the Nginx config files
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY default.conf.template /etc/nginx/templates/default.conf.template
|
||||
COPY nginx/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY nginx/*.conf.template /etc/nginx/templates/
|
||||
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Copy over build artifacts
|
||||
COPY --from=builder /usr/src/app/dist /usr/share/nginx/html
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# vim: ft=nginx
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
|
||||
# =====FRONTEND HOSTING=====
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
# vim: ft=nginx
|
||||
server {
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
location ~ /api/v1/posts/ {
|
||||
proxy_pass http://${RB_BLOG}/api/v1/posts/;
|
||||
}
|
||||
|
||||
location ~ /api/v1/sections/ {
|
||||
proxy_pass http://${RB_BLOG}/api/v1/sections/;
|
||||
}
|
||||
}
|
|
@ -52,18 +52,4 @@ server {
|
|||
return 405;
|
||||
}
|
||||
|
||||
|
||||
# =====FRONTEND HOSTING=====
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
|
@ -27,5 +27,7 @@ http {
|
|||
gzip on;
|
||||
|
||||
# This order is important, as the Matrix matches should be evaluated first
|
||||
include /etc/nginx/conf.d/matrix.conf;
|
||||
include /etc/nginx/conf.d/gateway.conf;
|
||||
include /etc/nginx/conf.d/default.conf;
|
||||
}
|
Loading…
Reference in New Issue