Browse Source

better nginx config

tags/2.0.0-beta
Carsten Brandt 11 years ago
parent
commit
58bac36fbc
  1. 21
      docs/guide/installation.md

21
docs/guide/installation.md

@ -119,18 +119,31 @@ resulting in "prettier" URLs without the need for `index.php` references.
~~~ ~~~
server { server {
set $yii_bootstrap "index.php";
charset utf-8; charset utf-8;
client_max_body_size 128M;
listen 80; listen 80; ## listen for ipv4
server_name mysite.local; #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
root /path/to/project/web
server_name mysite.local;
root /path/to/project/web;
index $yii_bootstrap;
access_log /path/to/project/log/access.log main; access_log /path/to/project/log/access.log main;
error_log /path/to/project/log/error.log;
location / { 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$ { location ~ \.php$ {
include fastcgi.conf; include fastcgi.conf;
fastcgi_pass 127.0.0.1:9000; fastcgi_pass 127.0.0.1:9000;

Loading…
Cancel
Save