diff --git a/Dockerfile b/Dockerfile index d6fffeed..58e5ba74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/contrib/nginx/cinny.domain.tld.conf b/contrib/nginx/cinny.domain.tld.conf index b735de1c..360302c0 100644 --- a/contrib/nginx/cinny.domain.tld.conf +++ b/contrib/nginx/cinny.domain.tld.conf @@ -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; } } diff --git a/docker-nginx.conf b/docker-nginx.conf new file mode 100644 index 00000000..6994b8c8 --- /dev/null +++ b/docker-nginx.conf @@ -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; + } +} \ No newline at end of file