error with etherpad

This commit is contained in:
tuanvu
2026-02-12 12:23:47 +01:00
parent 20d83ffafe
commit d8eb08a5f1
6 changed files with 114 additions and 28 deletions

View File

@@ -13,7 +13,7 @@ RUN npx ng build
FROM nginx:alpine
COPY --from=build /app/dist/tlcfront /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY nginxFront.conf /etc/nginx/conf.d/default.conf
EXPOSE 80

View File

@@ -1,16 +1,29 @@
server {
location /api/polls {
proxy_pass http://back:8080;
proxy_set_header Host $http_host;
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Proxy /api and all subpaths to backend service (back container on port 8080)
location /api/ {
proxy_pass http://back:8080/api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Connection "";
}
# Also handle /api without trailing slash
location = /api {
proxy_pass http://back:8080/api;
}
# SPA fallback for client-side routing
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html?$args;
try_files $uri $uri/ /index.html;
}
error_page 500 502 503 504 /50x.html;

View File

@@ -1,6 +1,6 @@
FROM nginx:latest
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY nginxFront.conf /etc/nginx/conf.d/default.conf
COPY index.html /usr/share/nginx/html/