Nginx

Nginx is a high-performance web server and reverse proxy. In a umh-core deployment, nginx can be used as the proxy for incoming HTTP requests, handling SSL and routing requests to the appropriate services.

Why a proxy?

umh-core pipelines can expose HTTP endpoints using the http_server input. These endpoints allow external systems to send data to umh-core. However, these endpoints should be secured. It is possible to manage certificates in each of those inputs but it is inconvenient to maintain as certificates have to be replaced regularly.

Adding Nginx in the existing Docker Compose Configuration

Add nginx to your docker-compose.yaml within the services section:

  services:
+   nginx:
+     image: management.umh.app/oci/library/nginx:1.27.3-alpine
+     restart: unless-stopped
+     ports:
+       - 80:80   # for http access
+       - 443:443 # for https access

Nginx Configuration File

Refer to the Nginx documentationarrow-up-right for how to create your own configuration.

If you want to customize the nginx.conf create an nginx.conf file in the same directory as your docker-compose.yaml and mount it:

Refer to the Nginx documentationarrow-up-right for what you can do in this configuration.

Adding a simple http/https forward

SSL

Obtain certificates from a trusted Certificate Authority (CA) or use Let's Encrypt. Place the *.crt and *.key file in the certs directory and create a nginx.conf for nginx which uses those certificates.

The file structure should now look similar to this.

The docker-compose.yaml has to mount certs and nginx.conf in appropriate places for nginx. This would look similar to this example:

Last updated