1
0
Fork 0
forked from mirror/cinny

add ngnix conf file for docker build (#1837)

This commit is contained in:
Ajay Bura 2024-07-24 18:21:03 +05:30 committed by GitHub
parent b387370aaf
commit 2157f9a322
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 4 deletions

View file

@ -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

View file

@ -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
docker-nginx.conf Normal file
View file

@ -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;
}
}