uwsgi-docs icon indicating copy to clipboard operation
uwsgi-docs copied to clipboard

MacOS: the web port socket in nginx.conf is not same with the http port in uwsgi

Open RobinHuang123 opened this issue 7 years ago • 3 comments
trafficstars

Hi, I am deploying the Django project with uwsgi and nginx in my MacBook. I find the the web port socket in nginx.conf is not same with the http port in uwsgi. Is it a normal issue ? Shall we need document it.

  • Here is the example:

    upstream django { #the uwsgi http port is 8001, if use "server 127.0.0.1:8001", it will NOT work. server 127.0.0.1:8001 # for a web port socket }

  • Then I use 'lsof -i ' to find the uwsgi port.

uwsgi 94404 xxxxx 3u IPv4 0x8aa587e728d89645 0t0 TCP localhost:49557 (LISTEN) uwsgi 94404 xxxxx 4u IPv4 0x8aa587e730038bc5 0t0 TCP *:vcom-tunnel (LISTEN)

  • I update the port to 49557. Now it works.

    upstream django { server 127.0.0.1: 49557 # for a web port socket }

  • The port is changed when uwsgi is restarted. Then I need to update nginx.conf.

  • BTW, the following configure works well in Mac. upstream django { server unix:///path/to/your/mysite/mysite.sock; # for a file socket }

RobinHuang123 avatar Apr 21 '18 06:04 RobinHuang123

The port being random every time is not normal.

What does your uwsgi configuration look like?

akx avatar Apr 21 '18 07:04 akx

@akx

Here is my configure file uswgi.ini: [uwsgi]

http = 127.0.0.1:8001 chdir = /Users/xxxx/Sites/mysite/ module = mysite.wsgi home = /Library/Frameworks/Python.framework/Versions/3.6/bin master = true processes = 2 vacuum = true

RobinHuang123 avatar Apr 21 '18 08:04 RobinHuang123

Hi @akx ,

Do you have any comment for the configuration ?

RobinHuang123 avatar Apr 26 '18 14:04 RobinHuang123