0

I have the following directory structure for my websites:

/var/www/sitename/subdomain/(public|log)

e.g /var/www/stackoverflow.com/careers/public/index.html

Can I make a single generic nginx configuration to do this? So that every domain is mapped to the right directory? I would not like to edit my nginx configuration for every website I add.

The root domain can always be mapped to the www subdomain.

Peter Smit
  • 1,649
  • 4
  • 21
  • 37
  • 1
    The response you would get from the people who've used nginx the longest (in the IRC and on the mailing list) is to generate your configuration file automatically as it will work faster. – Martin Fjordvald May 06 '10 at 10:46

2 Answers2

1

See this - http://cafuego.net/2009/07/15/playing-nginx

localhost
  • 11
  • 1
  • Please, give a small abstract here in the answer. That prevents this information from getting lost in the future. – Peter Smit Mar 16 '11 at 10:44
0

See here

Alexander Azarov
  • 3,510
  • 20
  • 19
  • The link you provided is dead. Could you update the link and give a small abstract here in the answer? – Peter Smit Mar 16 '11 at 10:43
  • It was link to my answer to another question -- it seems died along with the question. I've updated the answer with another link – Alexander Azarov Mar 23 '11 at 08:22
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/317846) – mzhaase Apr 13 '17 at 12:46
  • 1
    @mzhaase "the linked page" is hosted at stack exchange. So it would "become invalid" only if overly concerned community people deleted it. If so, why would it fit here? In any case I'm not going to invest my time. – Alexander Azarov Apr 13 '17 at 13:02