mirror of
https://github.com/daniviga/bite.git
synced 2025-04-20 14:31:20 +02:00
Fix 400 error with Arduino telemetry and Nginx
This was caused by the client not waiting for a response. Also Content-Length header was bogus.
This commit is contained in:
parent
b0b0f866df
commit
45d12b11a8
@ -162,7 +162,7 @@ void postData(const netConfig &postAPI, const String &URL, const DynamicJsonDocu
|
|||||||
ethClient.println(postAPI.port);
|
ethClient.println(postAPI.port);
|
||||||
ethClient.println("Content-Type: application/json");
|
ethClient.println("Content-Type: application/json");
|
||||||
ethClient.print("Content-Length: ");
|
ethClient.print("Content-Length: ");
|
||||||
ethClient.println(measureJsonPretty(json));
|
ethClient.println(measureJson(json));
|
||||||
ethClient.println("Connection: close");
|
ethClient.println("Connection: close");
|
||||||
ethClient.println();
|
ethClient.println();
|
||||||
serializeJson(json, ethClient);
|
serializeJson(json, ethClient);
|
||||||
|
@ -51,6 +51,7 @@ http {
|
|||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://bite;
|
proxy_pass http://bite;
|
||||||
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Host $http_host;
|
proxy_set_header Host $http_host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-Host $host:$server_port;
|
proxy_set_header X-Forwarded-Host $host:$server_port;
|
||||||
@ -59,6 +60,9 @@ http {
|
|||||||
|
|
||||||
proxy_read_timeout 300;
|
proxy_read_timeout 300;
|
||||||
proxy_connect_timeout 300;
|
proxy_connect_timeout 300;
|
||||||
|
|
||||||
|
## !- This is mandatory for IoT that do not wait for a reply -! ##
|
||||||
|
proxy_ignore_client_abort on;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /mqtt {
|
location /mqtt {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user