nginx and uwsgi in docker in vagrant in vmware - Permission denied on socket

Larry Martell larry.martell at gmail.com
Sun Aug 20 13:52:49 UTC 2017


I changed the socket to be in /var/run and that fixed the issue. But
now I am getting a 403 on all the static files, e.g:

2017/08/20 13:42:37 [error] 1140#1140: *8 open()
"/opt/django/CAPgraph/static/scripts/bootstrap.min.js" failed (13:
Permission denied), client: 10.0.2.2, server: , request: "GET
/static/scripts/bootstrap.min.js HTTP/1.1", host: "localhost:9003",
referrer: "http://localhost:9003/"

Any ideas on that?

On Sat, Aug 19, 2017 at 7:33 PM, Larry Martell <larry.martell at gmail.com> wrote:
> Inside the docker container the dir is /opt/django/CAPgraph/.
>
> That is mounted as a volume in docker from a dir in the
> vagrant/virtual box VM from /home/vagrant/CAPgraph.
>
> That dir is virtual box disk is created as
> C:\Users\Administrator\VirtualBox
> VMs\CAPgraph_default_1503066942637_58036\box-disk1.vmdk in the VMware
> VM.
>
> That is created on the Mac as /Users/LarryMartell/Documents/Virtual
> Machines.localized/Windows Server 2016.vmwarevm.
>
> Inside the docker container the file look like a socket:
>
> # ls -l app.sock
> srw-rw-rw- 1 root root 0 Aug 19 16:56 app.sock
>
> uwsgi creates it and binds to it without an error.
>
>
>
> On Sat, Aug 19, 2017 at 6:14 PM, Guilherme Capilé via nginx
> <nginx at nginx.org> wrote:
>> Ola,
>>
>> are you trying to create a linux socket on a directory mounted from a
>> windows disk? afaik, it won't work, it's not only about file
>> permissions, but a socket is a different type of file.
>>
>> Place the socket somewhere else (like /var/run/aoo.sock).
>>
>> Cheers,
>>
>> Guilherme Capilé
>>
>> On Sat, Aug 19, 2017 at 4:59 PM, Larry Martell <larry.martell at gmail.com> wrote:
>>> Don't ask why, but on my mac I am running Windows Server 2016 in
>>> VMware. In there I am running Ubuntu in vagrant/Virtual Box. In there
>>> I am trying to run a django app in a docker container with
>>> nginx/uwsgi.
>>>
>>> The socket is being created, but then when I try and connect to the
>>> site it fails with this nginx error:
>>>
>>> 2017/08/19 16:56:29 [crit] 1251#1251: *1 connect() to
>>> unix:///opt/django/CAPgraph/app.sock failed (13: Permission denied)
>>> while connecting to upstream, client: 10.0.2.2, server: , request:
>>> "GET / HTTP/1.1", upstream:
>>> "uwsgi://unix:///opt/django/CAPgraph/app.sock:", host:
>>> "localhost:9003"
>>>
>>>
>>> I have verified that the app.sock file and all dirs along the path are
>>> 777. The /opt/django/CAPgraph dir is a docker volume mounted from a
>>> local dir in the vagrant/Virtual Box VM
>>>
>>> How can I debug this further?


More information about the nginx mailing list