diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 507b17706b5..d7ee943ff2a 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -132,6 +132,8 @@ services: - ${MF_NGINX_SSL_PORT}:${MF_NGINX_SSL_PORT} - ${MF_NGINX_MQTT_PORT}:${MF_NGINX_MQTT_PORT} - ${MF_NGINX_MQTTS_PORT}:${MF_NGINX_MQTTS_PORT} + - ${MF_NGINX_COAP_PORT}:${MF_NGINX_COAP_PORT} + - ${MF_NGINX_COAPS_PORT}:${MF_NGINX_COAPS_PORT} networks: - mainflux-base-net env_file: @@ -142,6 +144,7 @@ services: - mqtt-adapter - http-adapter - ws-adapter + - coap-adapter things-db: image: postgres:13.3-alpine diff --git a/docker/nginx/nginx-key.conf b/docker/nginx/nginx-key.conf index e60b6661e1e..c374b74d706 100644 --- a/docker/nginx/nginx-key.conf +++ b/docker/nginx/nginx-key.conf @@ -142,13 +142,13 @@ http { } } -# MQTT stream { include snippets/stream_access_log.conf; + # MQTT # Include single-node or multiple-node (cluster) upstream include snippets/mqtt-upstream.conf; - + server { listen ${MF_NGINX_MQTT_PORT}; listen [::]:${MF_NGINX_MQTT_PORT}; @@ -159,13 +159,8 @@ stream { proxy_pass mqtt_cluster; } -} - -# CoAP -stream { - include snippets/stream_access_log.conf; - # Include upstream + # CoAP include snippets/coap-upstream.conf; server { @@ -179,4 +174,5 @@ stream { proxy_pass coap_cluster; } } + error_log info.log info; diff --git a/docker/nginx/nginx-x509.conf b/docker/nginx/nginx-x509.conf index be17e293f64..a381eb640a3 100644 --- a/docker/nginx/nginx-x509.conf +++ b/docker/nginx/nginx-x509.conf @@ -133,11 +133,14 @@ stream { js_import authorization from /etc/nginx/authorization.js; - # Include single-node or multiple-node (cluster) upstream - include snippets/mqtt-upstream.conf; ssl_verify_client on; include snippets/ssl-client.conf; + # MQTT + # Include single-node or multiple-node (cluster) upstream + include snippets/mqtt-upstream.conf; + + server { listen ${MF_NGINX_MQTT_PORT}; listen [::]:${MF_NGINX_MQTT_PORT}; @@ -149,21 +152,9 @@ stream { proxy_pass mqtt_cluster; } -} - -#CoAP -stream { - include snippets/stream_access_log.conf; - - # Include JS script for mTLS - js_path "/etc/nginx/njs/"; - js_import authorization from /etc/nginx/authorization.js; - - # Include upstream + # CoAP include snippets/coap-upstream.conf; - ssl_verify_client on; - include snippets/ssl-client.conf; server { listen ${MF_NGINX_COAP_PORT}; diff --git a/docker/nginx/snippets/coap-upstream.conf b/docker/nginx/snippets/coap-upstream.conf index 90bb790f082..da6c4b87e0b 100644 --- a/docker/nginx/snippets/coap-upstream.conf +++ b/docker/nginx/snippets/coap-upstream.conf @@ -2,5 +2,5 @@ # SPDX-License-Identifier: Apache-2.0 upstream coap_cluster { - server coap-adapter:${MF_COAP_ADAPTER_HTTP_PORT}; -} \ No newline at end of file + server coap-adapter:5683; +}