Welcome! Log In Create A New Profile


Nginx + Flask + uWSGI + port redirection

Posted by omistern 
Nginx + Flask + uWSGI + port redirection
October 20, 2021 04:56PM
Hello, everyone.

I'm a beginner with Nginx and facing some problems.
I have a raspberry pi with fixed ip, running nginx listenning at port 80, with flask and flask-socketio. I followed a lot of tutorials in internet but always got the same issue: "502 Bad Gateway".

I guess that my problem is the port rediretion, becouse in my local network the port is 80, but for connections comming from internet, the port is 3135 (becouse my internet provider have restrictions about port 80), but I'm not sure if this is the root of my problem.

I'm a begginer with websocket too, so there ara a huge possibility that I'm doing something wrong with the configuration files.

I don't know if this information is usefull, but I'll tell what my application does (meybe it could clarify my problems to you all).

Flask app:
Connect to a MQTT provider (same server running nginx) and get latitude, longitude and speed of a car and send this information to my webpage.

Using javascript, my webpage uses these informations with leaflet and shows a map and a marker (car position) with a poopup showing the actual car speed.

For connections comming from internet, I have three ports available: 3135, 3136 and 8886 that can be used to make this project works.

I'm sorry if i wrote something wrong, but I'm brazillian and english is my second language.

Thanks a lot!!
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 99
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready