From 679d729fd978ba6ba29f084d36225ad72fd160ed Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Thu, 12 Aug 2021 14:58:55 +0200 Subject: [PATCH 1/2] add basic auth for kalliope & disable it for the rest --- config/proxy/web.conf | 65 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/config/proxy/web.conf b/config/proxy/web.conf index 9993ea7..a79cf44 100644 --- a/config/proxy/web.conf +++ b/config/proxy/web.conf @@ -8,7 +8,7 @@ http { listen [::]:80 default_server; server_name dev.contacthub.lblod.info; - location / { + location /v3/api-docs { auth_basic "Contact Hub realm"; auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; proxy_http_version 1.1; @@ -20,6 +20,69 @@ http { client_max_body_size 3072m; } + location /delta { + auth_basic "Contact Hub realm"; + auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_pass http://identifier; + client_max_body_size 3072m; + } + + location /bulk { + auth_basic "Contact Hub realm"; + auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_pass http://identifier; + client_max_body_size 3072m; + } + + location /changes { + auth_basic "Contact Hub realm"; + auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_pass http://identifier; + client_max_body_size 3072m; + } + + location /consolidated { + auth_basic "Contact Hub realm"; + auth_basic_user_file /etc/nginx/conf.d/nginx.htpasswd; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_pass http://identifier; + client_max_body_size 3072m; + } + + + location / { + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + proxy_pass http://identifier; + client_max_body_size 3072m; + } + + location ~ /authorization/callback(.*) { + rewrite ^ /torii/redirect.html permanent; + } + } } \ No newline at end of file From ebfd8e6b824477299d7b0225af8df4f1ca8a8d15 Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Thu, 12 Aug 2021 15:05:23 +0200 Subject: [PATCH 2/2] add proxy --- docker-compose.dev.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 96c34f0..98be27d 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,9 +1,19 @@ version: '3.4' services: - identifier: + web: + image: nginx + volumes: + - ./config/proxy:/etc/nginx/conf.d + - ./config/proxy/web.conf:/etc/nginx/nginx.conf:ro + links: + - identifier:identifier + labels: + - "logging=true" + restart: always ports: - "80:80" + identifier: restart: "no" dispatcher: restart: "no"