Skip to content

Commit

Permalink
Remove multiple stream directives
Browse files Browse the repository at this point in the history
Signed-off-by: felix.gateru <[email protected]>
  • Loading branch information
felixgateru committed Oct 22, 2023
1 parent ba4cc2f commit 4c6a6c4
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 25 deletions.
3 changes: 3 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -142,6 +144,7 @@ services:
- mqtt-adapter
- http-adapter
- ws-adapter
- coap-adapter

things-db:
image: postgres:13.3-alpine
Expand Down
12 changes: 4 additions & 8 deletions docker/nginx/nginx-key.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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 {
Expand All @@ -179,4 +174,5 @@ stream {
proxy_pass coap_cluster;
}
}

error_log info.log info;
21 changes: 6 additions & 15 deletions docker/nginx/nginx-x509.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand All @@ -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};
Expand Down
4 changes: 2 additions & 2 deletions docker/nginx/snippets/coap-upstream.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# SPDX-License-Identifier: Apache-2.0

upstream coap_cluster {
server coap-adapter:${MF_COAP_ADAPTER_HTTP_PORT};
}
server coap-adapter:5683;
}

0 comments on commit 4c6a6c4

Please sign in to comment.