facebook twitter hatena line google mixi email

Linux/nginx/php-symfony

提供: 初心者エンジニアの簡易メモ
移動: 案内検索

symfonyのnginx.confサンプル

server {
   listen       80; #default_server;
   server_name  leaning-symfony2;
   #charset koi8-r;
   #access_log  logs/host.access.log  main;
   # Load configuration files for the default server block.
   #include /etc/nginx/default.d/*.conf;
   root /var/www/php/leaning-symfony2/web;
   index   app_dev.php;
   location / {
     if (!-e $request_filename) {
       rewrite ^/(.*)$ /app_dev.php?q=$1 last;
     }
   }
   location ~ \.php$ {
     root /var/www/php/leaning-symfony2/web;
     fastcgi_pass   127.0.0.1:9000;
     fastcgi_index  app_dev.php;
     fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
     include        fastcgi_params;
   }
   location ~ /\.ht {
       deny all;
   }
}