mqtt.33co.de working

This commit is contained in:
2022-10-22 00:38:01 +03:00
parent 4890878321
commit e05560f5d3
2 changed files with 76 additions and 1 deletions

View File

@@ -19,11 +19,22 @@ log_facility 5
``` ```
## Nginx router
[setup nginx](https://www.nginx.com/blog/nginx-plus-iot-load-balancing-mqtt/) Install nginx
```
sudo dnf install nginx
```
conf file [here](nginx.conf)
check firewal and selinux in case of problem
sudo firewall-cmd --permanent --zone=public --add-port=8883/tcp
### change in Node-RED
add the server address mqtt.33co.de por 8883
and select use TLS
## Setup test local environment ## Setup test local environment
**20 October 2022** **20 October 2022**

64
nginx.conf Normal file
View File

@@ -0,0 +1,64 @@
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
include /etc/nginx/conf.d/*.conf;
server {
server_name mqtt.33co.de;
listen 80;
root /usr/share/nginx/html;
index index.php index.html index.htm;
location ~ /.well-known {
allow all;
}
}
}
stream {
upstream mosquitto {
server XXX.XXX.XXX.XXX:1883;
}
server {
listen 8883 ssl;
proxy_pass mosquitto;
ssl_certificate /etc/letsencrypt/live/mqtt.33co.de/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mqtt.33co.de/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH";
ssl_ecdh_curve secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_tickets off;
}
}