Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm used to put them in /var/www or /home/www with a symlynk to /var/www when using apache. Not sure why, but I read that it was a security matter.

Is that the place for nginx websites too?

share|improve this question

The most appropriate place for web content under any server is under /srv.

share|improve this answer

If you are looking for a standard, then the standard would be defined by the Filesystem Hierarchy Standard. This standard says that they should be located beneath /srv. If the data is owned by one particular user, then locating the files under that user's home directory is also appropriate. /var/www is the most common location for this. However, this directory is not defined by the standard.

share|improve this answer

I'm mostly using /home/$site-owning-user/|logs), as the sites my servers host are user-controlled; or /home/$site-owning-group/... if multiple users are controlling a site. This keeps all of a user's files together for easier backup and monitoring and such.

For non-user-controlled sites (eg webapps installed by the sysadmin from packages), /srv probably makes more sense

share|improve this answer

Since Nginx has the root directive to point to where files are, choosing the place to put them really is mostly a matter of taste and setup needs.

However it is common Practice to either put them in /www, /var/www, or /srv/www with the later a symlink to /var/www (depending on the distro)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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