Skip to content

Commit

Permalink
add ngnix conf file for docker build (cinnyapp#1837)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura authored Jul 24, 2024
1 parent b387370 commit 2157f9a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN npm run build
FROM nginx:1.27.0-alpine

COPY --from=builder /src/dist /app
COPY --from=builder /src/docker-nginx.conf /etc/nginx/conf.d/default.conf

RUN rm -rf /usr/share/nginx/html \
&& ln -s /app /usr/share/nginx/html
15 changes: 11 additions & 4 deletions contrib/nginx/cinny.domain.tld.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@ server {

location / {
root /opt/cinny/dist/;
index index.html;
}
location ~* ^\/(login|register) {
try_files $uri $uri/ /index.html;

rewrite ^/config.json$ /config.json break;
rewrite ^/manifest.json$ /manifest.json break;

rewrite ^.*/olm.wasm$ /olm.wasm break;
rewrite ^/pdf.worker.min.js$ /pdf.worker.min.js break;

rewrite ^/public/(.*)$ /public/$1 break;
rewrite ^/assets/(.*)$ /assets/$1 break;

rewrite ^(.+)$ /index.html break;
}
}
16 changes: 16 additions & 0 deletions docker-nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
server {
location / {
root /usr/share/nginx/html;

rewrite ^/config.json$ /config.json break;
rewrite ^/manifest.json$ /manifest.json break;

rewrite ^.*/olm.wasm$ /olm.wasm break;
rewrite ^/pdf.worker.min.js$ /pdf.worker.min.js break;

rewrite ^/public/(.*)$ /public/$1 break;
rewrite ^/assets/(.*)$ /assets/$1 break;

rewrite ^(.+)$ /index.html break;
}
}

0 comments on commit 2157f9a

Please sign in to comment.