Home>

A web application is being created using flask, uwsgi, and nginx.

[Current status]

Create a simple file with flask and complete the nginx configuration.

However, if uwsgi is not set up properly and an IP address is entered in the browser, a 502 error occurs. (Probably due to socket connection)

When the following command is entered on the command line and the server's IP address is entered in the browser, the hello world characters created by the flame are displayed.

uwsgi --socket /var/www/dir/uwsgi.sock --module hello --callable app --chmod-socket = 666


This is going well.

Because it is troublesome to describe the settings every time, the above settings are compiled in hello.ini.

uwsgi --socket /var/www/dir/uwsgi.sock --module hello --callable app --chmod-socket = 666,
Put this in hello.ini and

uwsgi --ini hello.ini


If this is entered on the command line and the ip address is passed to the browser, a 502 error will occur.

The following error has occurred.

socket option is missing and stdin is not a socket.

I read the error that the socket is missing or not a socket.

I think that socket is described in hello.ini.

# hello.ini
module = hello
callable = app
master = true
socket = /var/www/dir/uwsgi.sock
chmod-socket = 666
logto = /var/log/uwsgi_error.log
vacuum = true
die-on-term = true
processes = 1

This command works well for hello world,

uwsgi --socket /var/www/dir/uwsgi.sock --module hello --callable app --chmod-socket = 666


I don't know why this command doesn't work.

uwsgi --ini hello.ini

Please give me an explanation.