W
W
wawa2018-09-22 22:16:52
Python
wawa, 2018-09-22 22:16:52

Why does python get 503 when accessing a server on Virtualbox?

The situation is this.
The host is Win10 x64, running Virtualbox with Ubuntu.
Running a 4-worker Django + uWSGI application on Ubuntu (no NGINX) at 0.0.0.0:8000.
Ubuntu port 8000 forwarded to 127.0.0.1:8080 host.
If you make a request to jung from inside Ubuntu (no matter what - browser, scripts, ..), then everything is ok.
If you make a request to jung from the host (i.e. Windows) through a browser, then everything is also ok.
If you make a request to the jang from the host (i.e. Windows) using a stored procedure MSSQL (on Transact-SQL), then, strangely enough, everything is also ok.
BUT, if I make a request to jung from the host (i.e. Windows) using python (via urllib or requests), then I always get a 503 error, while the uWSGI logs are empty.
Why is that? and how to fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
wawa, 2018-10-01
@wawa

It's just that the port on Ubuntu was busy with something. And for some reason this something was responding forward to uwsgi when requested from python. While requests from other clients ended up on uwsgi.
I changed the port and localhost to 192.168.*.* and everything is ok.

V
Vladimir Varlamov, 2018-09-26
@bes_internal

not like this? https://stackoverflow.com/a/40470853

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question