From c38a032fa54d0bccf9ca192affe93ce70cbb7dc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleksandar=20Novakovi=C4=87?= Date: Mon, 28 May 2018 19:20:17 +0200 Subject: [PATCH] Add version endpoint to nginx configuration (#316) Signed-off-by: Aleksandar Novakovic --- docker/nginx.conf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docker/nginx.conf b/docker/nginx.conf index fe13e1f0..ca0544fa 100644 --- a/docker/nginx.conf +++ b/docker/nginx.conf @@ -153,6 +153,22 @@ http { } } + location /version { + proxy_redirect off; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_pass http://things:8182; + + # Allow OPTIONS method CORS + if ($request_method = OPTIONS ) { + add_header Content-Length 0; + add_header Content-Type text/plain; + return 200; + } + } + # Proxy pass to mainflux-http-adapter location /http/ { proxy_redirect off;