5

I have created a folder to the default server at /var/www/default and everything works as expected. Inside that folder I made a symlink to ~/WebstormProjects/my-project, using the common ln -s. It worked for a while, and the last time I updated using apt-get, nginx doesn't follow anymore the symbolic link, which gives me a 404 error, not even listing the symlinks as it used to do.

Tried using the disable_symlinks directive, setting it to off, and nothing happened. Also followed the steps in this link and still nothing. Also added myself to the www-data user, nothing.

But if I edit nginx.conf by changing the user directive to my own user and restarting the server does work, but I know that's a very bad practice and some day in the future it will not allow PHP-FPM to work.

So, what can I do to make nginx follow symlinks, without changing the owner of my source directories? BTW, I'm using Ubuntu 14.04.3 and nginx 1.4.6 installed via package manager.

2
  • disable_symlink has if_not_owner option Commented Oct 30, 2015 at 3:26
  • 1
    By setting it, I will enable disabling symlinks, which is not the behavior I want. Commented Oct 31, 2015 at 3:54

1 Answer 1

8

It was just a problem with permissions:

chmod 755 /home chmod 755 /home/user 

Got previous commands from this answer.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you so much! so I had to open read permission of parent directories!
I'd like to suggest, that you go back to your var/www folder and do chmod 2775 ./ This tells the kernel to make any new files and directories under it new or old to inherit the ownership and permissions of the current (what would be their parent) folder. Hope this helps

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.