So I have an nginx server running on Mac OSX and I am trying to create a symlink in my nginx www directory from somewhere else. In the browser I get the wonderful 403 Forbidden error. I have also tried chmod'ing my life away for the past few hours.

There doesn't seem to be anything on the stack about it. One thing concerns me is that I am not sure if symlinks are directly supported by ngninx on Mac.

Trying to use disable_symlink directive results in:

nginx: [emerg] unknown directive "disable_symlinks" in /usr/local/etc/nginx/nginx.conf:44`

Some info about my setup:
nginx -v : nginx version: nginx/1.4.2

To create the symlink I do the following:

cd /Users/levi/www
ln -s "/Users/levi/Desktop/.../client" "/Users/levi/www/client"

The error in the log:

[error] 11864#0: *7 open() "/Users/levi/www/client" failed (13: Permission denied), client:, server: _, request: "GET /client HTTP/1.1", host: "localhost"

Any help is much appreciated. Let me know if there's any more information I can give you.

  • I have the same problem on Windows 7 with nginx 1.4.0: unknown directive "disable_symlinks" Oct 11, 2014 at 7:45

2 Answers 2


I just ran into something similar. Turns out one of the directories along the way to the target had too-restrictive permissions. chmod 755 $HOME fixed it in my case.

  • 1
    Just a warning; this means anyone with access to your machine (other users, SSH, etc) will be able to access your home folder and, potentially, anything private within it.
    – Nick
    Jul 5, 2018 at 9:33

I can verify that symlinks with nginx work on the mac with nginx 1.2.7.

Symlink created as:

ln -s /Users/salpher/nginxtest /usr/local/opt/nginx/html/

Do you have any content in the 'client' directory? Directory index browsing is disabled by default and you will see a 403 forbidden if there is no index page and your url does not point at a particular content file.

If it's directory browsing that you're after you can enable that in your directory config with autoindex on;

    location / {
        autoindex on;
        root   html;
        index  index.html index.htm;
  • Yes, there are two files in the 'client' directory. Autoindex is turned on. I do not have an index file for the directory though or the root directive. I don't think that's creating the problem though. Dec 6, 2013 at 5:00
  • Can't seem to edit my other comment. I tried adding the root directive and an index directive, neither and both did not fix the issue. I also found that I get the same "permission denied" message when trying to point '/client' in the nginx config to the original 'client' directory. Dec 6, 2013 at 5:21
  • Do you also get a 403 when your URL points at an html file or something other than a directory?
    – Sam Alpher
    Dec 6, 2013 at 12:52
  • Yes I do. For example when trying to go to localhost/client/somefile.html Dec 6, 2013 at 13:18
  • If you haven't already you might check out serverfault.com/questions/218583/… . Sounds similar. Also, how did you install nginx? Was it a binary installation or did you grab the code and compile? If it was a binary installation where did it come from? For reference my test setup came from a brew installation.
    – Sam Alpher
    Dec 6, 2013 at 14:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.