Просмотр исходного кода

Upgrade Cinny (v3.2.0 -> v4.0.0) and adapt our custom nginx configuration with the new URL rewrites

Cinny includes nginx configuration which does URL rewrites now, as seen
here: https://raw.githubusercontent.com/cinnyapp/cinny/dev/docker-nginx.conf

That said, we have our own nginx configuration for Cinny, because we'd
like to run ngin as non-root and on a non-privileged port (80 -> 8080).

For this reason, we override `/etc/nginx/nginx.conf` and need to
duplicate what we see in `/etc/nginx/conf.d/default.conf` with our own
`server` block (which listens on port 8080).
pull/3446/head
Slavi Pantaleev 1 год назад
Родитель
Сommit
57eeb1be33
2 измененных файлов: 13 добавлений и 9 удалений
  1. +1
    -1
      roles/custom/matrix-client-cinny/defaults/main.yml
  2. +12
    -8
      roles/custom/matrix-client-cinny/templates/nginx.conf.j2

+ 1
- 1
roles/custom/matrix-client-cinny/defaults/main.yml Просмотреть файл

@@ -7,7 +7,7 @@ matrix_client_cinny_container_image_self_build: false
matrix_client_cinny_container_image_self_build_repo: "https://github.com/ajbura/cinny.git"

# renovate: datasource=docker depName=ajbura/cinny
matrix_client_cinny_version: v3.2.0
matrix_client_cinny_version: v4.0.0
matrix_client_cinny_docker_image: "{{ matrix_client_cinny_docker_image_name_prefix }}ajbura/cinny:{{ matrix_client_cinny_version }}"
matrix_client_cinny_docker_image_name_prefix: "{{ 'localhost/' if matrix_client_cinny_container_image_self_build else matrix_container_global_registry_prefix }}"
matrix_client_cinny_docker_image_force_pull: "{{ matrix_client_cinny_docker_image.endswith(':latest') }}"


+ 12
- 8
roles/custom/matrix-client-cinny/templates/nginx.conf.j2 Просмотреть файл

@@ -51,16 +51,20 @@ http {
root /usr/share/nginx/html;

location / {
index index.html index.htm;
}

location ~* ^/(config(.+)?\.json$|(.+)\.html$|i18n) {
expires -1;
}
# Inspired by: https://raw.githubusercontent.com/cinnyapp/cinny/dev/docker-nginx.conf

error_page 500 502 503 504 /50x.html;
location = /50x.html {
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;
}
}
}

Загрузка…
Отмена
Сохранить