Differences
This shows you the differences between two versions of the page.
nginx [2014/06/13 11:24] |
nginx [2014/06/13 11:24] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== nginx ====== | ||
+ | * [[OpenBSD nginx]] | ||
+ | |||
+ | * [[http://wiki.nginx.org/Pitfalls|nginx Pitfalls]] - must read before any nginx deployment | ||
+ | |||
+ | === Server Blocks === | ||
+ | |||
+ | * [[http://wiki.nginx.org/ServerBlockExample|nginx server blocks]] - same functionality as virtual hosts | ||
+ | |||
+ | <code> | ||
+ | server { | ||
+ | |||
+ | listen 80; | ||
+ | listen [::]:80; | ||
+ | server_name sub.domain.com; | ||
+ | root /var/www/vhosts/sub.domain.com/htdocs; | ||
+ | index index.html index.htm index.php; | ||
+ | |||
+ | } | ||
+ | </code> | ||
+ | |||
+ | === Directory Indexes === | ||
+ | |||
+ | Add ''autoindex'' for sitewide: | ||
+ | |||
+ | <code> | ||
+ | autoindex on; | ||
+ | </code> | ||
+ | |||
+ | Add ''autoindex'' for specific directories: | ||
+ | |||
+ | <code> | ||
+ | location /somedir { autoindex on; } | ||
+ | </code> |