Score:0

uWSGI application behind traefik

us flag

My current setup looks like:

request -> traefik (for https) -> NGINX -> uWSGI

where uWSGI is started with the following opts:

UWSGI_OPTS="--socket /tmp/uwsgi.sock \
            --http 0.0.0.0:5000 \
            ...

The docs say

If your proxy/webserver/router speaks HTTP, you have to tell uWSGI to natively speak the http protocol (this is different from --http that will spawn a proxy by itself):

So I understand the current config as

  • use a socket file /tmp/uwsgi.sock
  • create a http proxy at 0.0.0.0:5000 (for that socket file?)

Now I'd like to remove NGINX.

request -> traefik -> uWSGI

From the docs: traefik does not understand the uwsgi protocol, but it does work to use the http-socket:

UWSGI_OPTS="--http-socket 0.0.0.0:5000 \
            ...

My questions are:

  • the socket file /tmp/uwsgi.sock could be used to bind to NGINX uwsgi_pass unix:///tmp/uwsgi.sock;. As I do not use NGINX anymore I can remove it, correct?
  • http-socket is like the file-socket /tmp/... but does speak http. Where -http does create a proxy like nginx or traefik to use without an proxy before uwsgi, correct?
  • why can I still sucessfully directly curl the uWSGI service http://localhost:5000 even if the uWSGI proxy -http is not present anymore?
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.