Carl Patenaude Poulin
Carl Patenaude Poulin

Reputation: 6589

How can I make uWSGI listen to another machine?

I have two machines on the same LAN, machine A runs nginx and machine B runs uWSGI. I want nginx to communicate with uWSGI by TCP port 1717.

(Ideally, I'd like to do it using the service uwsgi start command so I can profit from the upstart script that's built in Ubuntu. I wouldn't mind editing that script but after looking at it I don't think it's the right thing to do!)

I tried running sudo uwsgi start --uwsgi-socket 127.0.0.1:1717 but it wouldn't work and nginx logs would show the following error (data in bracket sanitized):

2012/05/29 00:06:46 [error] 19608#0: *6 connect() failed (111: Connection refused) while connecting to upstream, client: {public ip}, server: {domain}, request: "GET / HTTP/1.1", upstream: "uwsgi://{machine B's IP}:1717", host: "{domain}"

Clearly this way isn't working. I don't know enough about uwsgi to fix this by myself, please help!

Upvotes: 1

Views: 1443

Answers (1)

roberto
roberto

Reputation: 12953

add

socket = address:1717

in the uwsgi configuration of your app

Upvotes: 1

Related Questions