[Flask] Particular order for starting Nginx/UWSGI?

Anthony Ford ford.anthonyj at gmail.com
Tue May 10 20:16:41 EDT 2016


Yeah, you shouldn't need to touch the firewall since it's entirely local
(IIRC that's caught at the kernel layer in most linuxes and routed without
ever really hitting the network stack or hw).

I'm sure there's a way to do it with unix socks. It's a standard (and
sometimes preferred) way of doing it. I've just never managed to get it
right.

With some effort, and perhaps some help from someone else on the
mailinglist, I'm sure you can get the unix socks working. And if you do,
let me know how!


Anthony Ford,
KF5IBN,
ford.anthonyj at gmail.com

On Tue, May 10, 2016 at 7:12 PM, Alex Hall <ahall at autodist.com> wrote:

> Yep, you got me. Unix sockets, because I read they're faster, and because
> punching holes in the Google Cloud firewall is a pain/must be approved by
> my boss. :) Although, maybe it won't need holes if it's all based on
> localhost--that's a good thought. I'll switch over to HTTP sockets tomorrow
> and see if that makes a difference. Thanks.
>
> On May 10, 2016, at 18:23, Anthony Ford <ford.anthonyj at gmail.com> wrote:
>
> As far as I know, only the uWSGI process creates the sockets. Are you
> using unix sockets or network sockets?
>
> Every time I've tried to get unix socks working, I've run into a
> permissions issue, and I've never had enough time to figure it out. Perhaps
> someone else on the list can point you in the right way.  Maybe you can try
> chmoding to 777 and see if that helps.
>
> I usually go for network sockets bound to 127.0.0.1 for security ("socket
> = 127.0.0.1:7000"). If you are using unix socks, you might also try the
> chown-socket and chmod-socket commands and set to the user/group your web
> server runs as (usually something like www or nginx) and a 660, 666, or 777.
>
>
>
> Anthony Ford,
> KF5IBN,
> ford.anthonyj at gmail.com
>
> On Tue, May 10, 2016 at 4:40 PM, Alex Hall <ahall at autodist.com> wrote:
>
>> Hi all,
>> I'm suddenly getting errors, where the socket used by Nginx and UWSGI
>> isn't reachable because of permission problems. This didn't happen until I
>> restarted both services (Nginx was acting up; I didn't restart it to try to
>> restart my app). Is there a specific order in which these pieces have to be
>> started or stopped to avoid problems, or is this something different? I
>> didn't change the socket details in any configuration file, so it almost
>> has to be the restarting of both services. Thanks.
>>
>> --
>> Alex Hall
>> Automatic Distributors, IT department
>> ahall at autodist.com
>>
>> _______________________________________________
>> Flask mailing list
>> Flask at python.org
>> https://mail.python.org/mailman/listinfo/flask
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20160510/1d6a047f/attachment.html>


More information about the Flask mailing list