nginx的配置文件(laravel)

worker_processes  1;

events {

worker_connections  1024;

}

http {

include       mime.types;

default_type  application/octet-stream;

sendfile        on;

keepalive_timeout  65;

server {

listen 80;

server_name laravel4.home.com;

root '/www/laravel-v4.2.11/public';

index index.html index.php;

location / {

try_files $uri $uri/ /index.php$is_args$query_string;

}

location ~ \.php$ {

try_files $uri =404;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

error_page   500 502 503 504  /50x.html;

location = /50x.html {

root   html;

}

}

server {

listen 80;

server_name laravel5.home.com;

root '/www/laravel5/public';

index index.html index.php;

location / {

try_files $uri $uri/ /index.php$is_args$query_string;

}

location ~ \.php$ {

try_files $uri =404;

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

error_page   500 502 503 504  /50x.html;

location = /50x.html {

root   html;

}

}

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Nginx简介 解决基于进程模型产生的C10K问题,请求时即使无状态连接如web服务都无法达到并发响应量级一万的现...
    魏镇坪阅读 2,081评论 0 9
  • 1.简介:  Nginx:engine X ,2002年,开源,商业版 http协议:web服务器(类似于ht...
    尛尛大尹阅读 1,896评论 0 3
  • 小伙伴在使用ThinkPHP搭建自己或者公司项目的时候,url模式设置成为兼容模式,也就是URL_MODEL的值为...
    思梦PHP阅读 1,239评论 0 1
  • 一个人可以有三种与世界交流的方式—— 与己交流(精神)与人交流(社交)与物交流(兴趣,包括动植物或机器) 回顾小编...
    化物有生阅读 797评论 0 1
  • 这篇文章写于2017.01.13。 最近,我开始回看那些经典的欧美电影,我乐此不疲,每天一部。这几天我已经看了冰雪...
    EugeniaQ阅读 363评论 0 0