[PR #1416] Add support for custom Nginx maintenance templates (NGINX_UI_NGINX_MAINTENANCE_TEMPLATE / Settings > Nginx) #5719

Open
opened 2026-03-01 15:42:23 +03:00 by kerem · 0 comments
Owner

Original Pull Request: https://github.com/0xJacky/nginx-ui/pull/1416

State: open
Merged: No


  • Add/use environment variable NGINX_UI_NGINX_MAINTENANCE_TEMPLATE to point the app to a custom maintenance HTML template used when maintenance mode is enabled.
  • Allow the maintenance template path to be configured from the web UI as well: Settings > Nginx.
  • If a custom path is provided (env var or UI), the app will load that file from inside the container. If not provided, the built-in default template is used.
  • Document how to provide custom templates by mounting a host directory into the container:
    • Example mount: ./nginx:/etc/nginx
    • Create a maintenance folder inside that mount: ./nginx/maintenance
    • Put your template file there, e.g. ./nginx/maintenance/maintenance.html
    • Set the template path to the absolute path inside the container:
      NGINX_UI_NGINX_MAINTENANCE_TEMPLATE=/etc/nginx/maintenance/maintenance.html
  • Notes:
    • The path must be the absolute path inside the container and the file must be readable by the nginx process (e.g., mode 644).
    • After changing the env var or updating templates (or changing the setting in Settings > Nginx), restart the container or reload nginx for changes to take effect.
    • You can store multiple templates under ./nginx/maintenance and switch between them by updating the env var or the UI setting.
  • Include example docker-compose snippet in docs:
    volumes:
    • ./nginx:/etc/nginx
      environment:
    • NGINX_UI_NGINX_MAINTENANCE_TEMPLATE=/etc/nginx/maintenance/maintenance.html

This commit adds configuration surface and documentation for using custom maintenance templates via environment variable or the UI.

image image
services:
  nginx-ui:
    image: nginx-ui-fixed:local
    container_name: nginx-ui
    restart: always
    stdin_open: true
    tty: true
    environment:
      - TZ=Europe/Berlin
      - GIN_MODE=release
      - NGINX_UI_NGINX_MAINTENANCE_TEMPLATE=enwikuna-maintenance.html

Kindly ask you to test and merge our changes into production line.

**Original Pull Request:** https://github.com/0xJacky/nginx-ui/pull/1416 **State:** open **Merged:** No --- - Add/use environment variable NGINX_UI_NGINX_MAINTENANCE_TEMPLATE to point the app to a custom maintenance HTML template used when maintenance mode is enabled. - Allow the maintenance template path to be configured from the web UI as well: Settings > Nginx. - If a custom path is provided (env var or UI), the app will load that file from inside the container. If not provided, the built-in default template is used. - Document how to provide custom templates by mounting a host directory into the container: - Example mount: ./nginx:/etc/nginx - Create a maintenance folder inside that mount: ./nginx/maintenance - Put your template file there, e.g. ./nginx/maintenance/maintenance.html - Set the template path to the absolute path inside the container: NGINX_UI_NGINX_MAINTENANCE_TEMPLATE=/etc/nginx/maintenance/maintenance.html - Notes: - The path must be the absolute path inside the container and the file must be readable by the nginx process (e.g., mode 644). - After changing the env var or updating templates (or changing the setting in Settings > Nginx), restart the container or reload nginx for changes to take effect. - You can store multiple templates under ./nginx/maintenance and switch between them by updating the env var or the UI setting. - Include example docker-compose snippet in docs: volumes: - ./nginx:/etc/nginx environment: - NGINX_UI_NGINX_MAINTENANCE_TEMPLATE=/etc/nginx/maintenance/maintenance.html This commit adds configuration surface and documentation for using custom maintenance templates via environment variable or the UI. <img width="913" height="280" alt="image" src="https://github.com/user-attachments/assets/130349d9-a03c-4f2d-85b3-7621a940f617" /> <img width="1339" height="630" alt="image" src="https://github.com/user-attachments/assets/81a42b3b-cd68-4bb6-ba79-85d75eacc993" /> ``` services: nginx-ui: image: nginx-ui-fixed:local container_name: nginx-ui restart: always stdin_open: true tty: true environment: - TZ=Europe/Berlin - GIN_MODE=release - NGINX_UI_NGINX_MAINTENANCE_TEMPLATE=enwikuna-maintenance.html ``` Kindly ask you to test and merge our changes into production line.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-ui#5719
No description provided.