Sign inSign up

dockerogc/nginx-ld

By dockerogc

Updated 5 months ago

Image
0

268

dockerogc/nginx-ld repository overview

nginx-ld

An nginx-based reverse proxy that serves a Prez deployment and dynamically generates redirect rules for linked data URI resolution.

On startup, the entrypoint generates an nginx config from environment variables and the bundled template, then starts nginx.

Environment variables

VariableRequiredDefaultDescription
EXTERNAL_PREZ_BACKEND_URLYesPublic-facing base URL of the Prez backend, used to build redirect targets (e.g. https://example.com/prez-b)
REDIRECTSYesNewline-separated list of prefix=base_url redirect rules (see below)
PREZ_BACKEND_URLNohttp://prez:8000Internal URL of the Prez backend service
PREZ_UI_URLNohttp://prez-ui:8080Internal URL of the Prez UI service
PREZ_BACKEND_PATHNo/prez-bPath prefix for the Prez backend proxy route
PREZ_UI_PATHNo/prezPath prefix for the Prez UI proxy route
FUSEKI_URLNohttp://fuseki:3030Internal URL of the Fuseki service
FUSEKI_PATHNo/fusekiPath prefix for the Fuseki proxy route
TEMPLATE_FILENo/etc/nginx/nginx.conf.templatePath to the nginx config template
OUTPUT_FILENo/etc/nginx/conf.d/default.confPath where the generated config is written

Proxy routes

PathProxied to
PREZ_UI_PATH (/prez)PREZ_UI_URL
PREZ_BACKEND_PATH (/prez-b)PREZ_BACKEND_URL
FUSEKI_PATH (/fuseki)FUSEKI_URL

Redirect rules (REDIRECTS)

REDIRECTS is a newline-separated list of prefix=base_url pairs. Each entry generates an nginx location block that redirects requests to the Prez object resolution endpoint.

A request to {prefix}/{id} is redirected to:

{EXTERNAL_PREZ_BACKEND_URL}/object/resource?uri={base_url}/{id}
Example
REDIRECTS=/def/ont=https://example.com/ontology
/def/voc=https://example.com/vocabulary

A request to /def/ont/MyClass redirects to:

https://example.com/prez-b/object/resource?uri=https://example.com/ontology/MyClass

Docker Compose example

services:
  nginx-ld:
    image: dockerogc/nginx-ld
    ports:
      - "8080:80"
    environment:
      EXTERNAL_PREZ_BACKEND_URL: https://example.com/prez-b
      REDIRECTS: |
        /def/ont=https://example.com/ontology
        /def/voc=https://example.com/vocabulary
    depends_on:
      - prez
      - prez-ui

Source

https://github.com/ogcincubator/ogc-docker

Tag summary

Content type

Image

Digest

sha256:fd244d652

Size

24.8 MB

Last updated

5 months ago

docker pull dockerogc/nginx-ld