码迷,mamicode.com
首页 > 其他好文 > 详细

nginx.conf中配置laravel框架站点

时间:2016-01-29 12:15:21      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:

nginx.conf配置如下:

user nginx nginx;
worker_processes 4;

error_log logs/error.log error;

pid logs/nginx.pid;
worker_rlimit_nofile 102400;

events {
use epoll;
worker_connections 1024;
}


http {
include mime.types;
default_type application/octet-stream;

log_format gzip ‘$remote_addr - $remote_user [$time_local] ‘
‘"$request" $status $bytes_sent ‘
‘"$http_referer" "$http_user_agent" "$gzip_ratio"‘;
access_log /spool/logs/nginx-access.log gzip buffer=32k;
#access_log logs/access.log main;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
#keepalive_timeout 65;

tcp_nopush on;
tcp_nodelay on;


fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 256k;
fastcgi_buffers 16 256k;
fastcgi_busy_buffers_size 512k;
fastcgi_temp_file_write_size 512k;
server_names_hash_bucket_size 128;
## Start: Size Limits & Buffer Overflows ##
client_body_buffer_size 1K;
client_header_buffer_size 1k;
client_max_body_size 2m;
large_client_header_buffers 4 2m;
## END: Size Limits & Buffer Overflows ##
## Start: Timeouts ##
client_body_timeout 10;
client_header_timeout 10;
keepalive_timeout 5 5;
send_timeout 10;
## End: Timeouts ##
gzip on;
gzip_min_length 1k;
gzip_buffers 8 32k;
gzip_http_version 1.1;
gzip_comp_level 3;
gzip_types text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/json application/atom+xml;
gzip_vary on;


server {
listen 80;
server_name beta.linda.funshion.com;
access_log logs/linda.access.log gzip buffer=32k;
error_log logs/linda.error.log;
set $root_path ‘/var/www/linda040/public‘;
root $root_path;

index index.php index.html index.htm;

try_files $uri $uri/ @rewrite;

location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}

location ~ \.php {
fastcgi_pass unix:/tmp/php-fpm.socket;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_index /index.php;

fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}

location ~ /\.ht {
deny all;
}
}

}

nginx.conf中配置laravel框架站点

标签:

原文地址:http://www.cnblogs.com/huanxiyun/p/5168133.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!