Permission denied - nginx and uwsgi socket

前端 未结 9 1748
暗喜
暗喜 2020-12-07 17:44

Well I am currently trying to get my django application served using nginx and uwsgi. I am currently using a virtual environment to which uwsgi is installed. However I am cu

9条回答
  •  有刺的猬
    2020-12-07 18:12

    uwsgi.ini

    [uwsgi]
    uid = yourusername
    gid = www-data
    chmod-socket = 664
    

    Why? Because sometimes the app needs to read or write to the file system beyond what's accessible to the web server. I don't want to change a whole bunch of ownership and permissions just to accommodate each such situation. I'd rather have my application run as me and do what it needs to do. Setting the group as www-data and chmoding the socket to 664 allows for that group to write to it, thus providing the only necessary window of communication between the web server and the app.

提交回复
热议问题