From 58bac36fbc62e10519ec8f202210138b28997dd8 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Thu, 21 Nov 2013 10:55:49 +0100 Subject: [PATCH] better nginx config --- docs/guide/installation.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/docs/guide/installation.md b/docs/guide/installation.md index adc7f04..1575163 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -119,18 +119,31 @@ resulting in "prettier" URLs without the need for `index.php` references. ~~~ server { + set $yii_bootstrap "index.php"; charset utf-8; + client_max_body_size 128M; - listen 80; - server_name mysite.local; - root /path/to/project/web + listen 80; ## listen for ipv4 + #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 + + server_name mysite.local; + root /path/to/project/web; + index $yii_bootstrap; access_log /path/to/project/log/access.log main; + error_log /path/to/project/log/error.log; location / { - try_files $uri $uri/ /index.php?$args; # Redirect everything that isn't real file to index.php including arguments. + # Redirect everything that isn't real file to yii bootstrap file including arguments. + try_files $uri $uri/ /$yii_bootstrap?$args; } + # uncomment to avoid processing of calls to unexisting static files by yii + #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { + # try_files $uri =404; + #} + #error_page 404 /404.html; + location ~ \.php$ { include fastcgi.conf; fastcgi_pass 127.0.0.1:9000;