Reverse proxy and HTTPS
Proxy inverso y HTTPS
The images speak plain HTTP. To publish Kubrik OS under your own address with HTTPS you put your own reverse proxy in front. This chapter says what it has to route, and how to adjust the administration app without rebuilding it.
Las imágenes hablan HTTP sin cifrar. Para publicar Kubrik OS bajo tu propia dirección con HTTPS ponés delante tu propio proxy inverso. Este capítulo dice qué tiene que rutear, y cómo ajustar la aplicación de administración sin reconstruirla.
What the delivery includes and what it does not
Qué trae la entrega y qué no
The delivery has no certificates and no HTTPS configuration. The nginx inside the administration image listens on port 80 only, serves the screens and forwards two paths to the application: /api/ and /actuator/. Everything about HTTPS is done in a proxy of your own, in front of both.
La entrega no trae certificados ni configuración de HTTPS. El nginx de la imagen de administración escucha solo en el puerto 80, sirve las pantallas y reenvía dos rutas a la aplicación: /api/ y /actuator/. Todo lo de HTTPS se hace en un proxy tuyo, delante de los dos.
What your proxy has to route
Qué tiene que rutear tu proxy
| Path | Send it to | Notes |
|---|---|---|
| /api/ | The application, port 8222 | It can also go through the administration container, which forwards it. |
| /ws/ | The application, port 8222 | Real-time notifications. It is a WebSocket: allow the connection upgrade. The nginx of the image does not forward this path. |
| /graphql | The application, port 8222 | The nginx of the image does not forward this path either. |
| /actuator/ | Nowhere public | Health and metrics. Keep it reachable from your monitoring network only. |
| Everything else | The administration container, port 80 | The screens. |
| Ruta | Mandala a | Notas |
|---|---|---|
| /api/ | La aplicación, puerto 8222 | También puede pasar por el contenedor de administración, que la reenvía. |
| /ws/ | La aplicación, puerto 8222 | Notificaciones en tiempo real. Es un WebSocket: permití el cambio de protocolo de la conexión. El nginx de la imagen no reenvía esta ruta. |
| /graphql | La aplicación, puerto 8222 | El nginx de la imagen tampoco reenvía esta ruta. |
| /actuator/ | A ningún lugar público | Salud y métricas. Dejala accesible solo desde tu red de monitoreo. |
| Todo lo demás | El contenedor de administración, puerto 80 | Las pantallas. |
- Serve the screens and the API under the same address. The administration app calls the API with relative paths.
- Pass the headers Host, X-Forwarded-For and X-Forwarded-Proto on to the application.
- Allow request bodies of at least 50 MB on /api/, which is the largest file the application accepts in one upload.
- Publish the file store under HTTPS too, under the address you gave in MINIO_S3_ENDPOINT.
- Serví las pantallas y la API bajo la misma dirección. La aplicación de administración llama a la API con rutas relativas.
- Pasale a la aplicación los encabezados Host, X-Forwarded-For y X-Forwarded-Proto.
- Permití cuerpos de pedido de al menos 50 MB en /api/, que es el archivo más grande que la aplicación acepta en una subida.
- Publicá también el almacén de archivos con HTTPS, bajo la dirección que pusiste en MINIO_S3_ENDPOINT.
Settings that follow the public address
Ajustes que acompañan a la dirección pública
Once the public address is decided, set it in APP_CORS_ALLOWED_ORIGINS, APP_BASE_URL and APP_MAIL_VERIFICATION_LINK_BASE, and recreate the application. They are described in the Configuration reference.
Una vez decidida la dirección pública, ponela en APP_CORS_ALLOWED_ORIGINS, APP_BASE_URL y APP_MAIL_VERIFICATION_LINK_BASE, y recreá la aplicación. Están descriptas en la Referencia de configuración.
Adjust the administration app without rebuilding
Ajustar la aplicación de administración sin reconstruir
The administration app reads an optional file, assets/config.json, every time it loads. The image does not bring one. To use it, write the file on the server and mount it over /usr/share/nginx/html/assets/config.json in the frontend service.
La aplicación de administración lee un archivo opcional, assets/config.json, cada vez que carga. La imagen no trae ninguno. Para usarlo, escribí el archivo en el servidor y montalo sobre /usr/share/nginx/html/assets/config.json en el servicio frontend.
| Key | What it does |
|---|---|
| defaultTenantId | The organisation identifier proposed on the sign-in screen when the browser remembers none. Put the identifier of your organisation. |
| enabledModules | The list of module codes the menu may show. It can only show fewer than the edition allows. |
| apiUrl · authUrl | Where the API is. Leave them out unless the API is published under a different address. |
| production · backofficeUrl · demoCredentials | Leave them out in a customer installation. |
| Clave | Qué hace |
|---|---|
| defaultTenantId | El identificador de organización que propone la pantalla de ingreso cuando el navegador no recuerda ninguno. Poné el de tu organización. |
| enabledModules | La lista de códigos de módulo que el menú puede mostrar. Solo puede mostrar menos de los que permite la edición. |
| apiUrl · authUrl | Dónde está la API. No las pongas, salvo que la API esté publicada bajo otra dirección. |
| production · backofficeUrl · demoCredentials | No las pongas en una instalación de cliente. |
Common issues
Problemas habituales
- "assets/config.json carries keys this build does not read"
- The file has a key that is not allowed, for example edition. Remove it; the message lists the allowed ones.
- "assets/config.json is not JSON"
- Your proxy answers the sign-in page when the file does not exist. A missing assets/config.json has to be answered with error 404.
- Notifications do not arrive until the page is reloaded
- /ws/ is not reaching the application, or the proxy does not allow the WebSocket upgrade.
- Uploading a large file fails
- The proxy limits the size of the request. Raise the limit on /api/.
- Images are not shown after moving to HTTPS
- The browser refuses plain HTTP content on an HTTPS page. Publish the file store under HTTPS and update MINIO_S3_ENDPOINT.
- «assets/config.json carries keys this build does not read»
- El archivo tiene una clave que no está permitida, por ejemplo edition. Sacala; el mensaje lista las permitidas.
- «assets/config.json is not JSON»
- Tu proxy contesta la página de ingreso cuando el archivo no existe. Un assets/config.json inexistente se tiene que contestar con el error 404.
- Las notificaciones no llegan hasta recargar la página
- /ws/ no está llegando a la aplicación, o el proxy no permite el cambio de protocolo del WebSocket.
- Falla la subida de un archivo grande
- El proxy limita el tamaño del pedido. Subí el límite en /api/.
- Las imágenes no se ven después de pasar a HTTPS
- El navegador rechaza contenido HTTP sin cifrar en una página HTTPS. Publicá el almacén con HTTPS y actualizá MINIO_S3_ENDPOINT.