配置laravel的nginx站点
server{}配置
server{
#端口配置
listen 80;
#域名配置
server_name laravel.cc; index index.php index.html index.htm;
#站点配置到public
root /data/wwwroot/laravel.cc/public;
#日志记录
access_log /data/logs/nginx.laravel.cc.log access;
error_log /data/logs/nginx.laravel.cc.error debug;
#静态文件配置
location ~ .*\.(jpg|jpeg|gif|png|bmp|css|js|swf|txt|ttf|woff|ico)$ {
expires 7d;
break;
} location / {
#重点区
try_files \$uri \$uri/ /index.php?$query_string;
index index.php index.html index.htm;
}
#静态文件配置
location /logs {
autoindex on;
autoindex_exact_size off;
autoindex_localtime on;
break;
}
#处理php配置
location ~ "\.php$" {
include fastcgi_params;
fastcgi_index index.php;
#在nginx.conf配置server_mango
fastcgi_pass server_mango;
}
}
http下的server_mango配置
http {
include mime.types;
default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"'; log_format access '$remote_addr [$time_local] "$http_host" "$request" "$status $body_bytes_sent" "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main; sendfile on;
tcp_nopush on;
server_tokens off; #keepalive_timeout 0;
keepalive_timeout 65; gzip on;
gzip_min_length 5k;
gzip_buffers 4 16k;
#gzip_http_version 1.0;
gzip_comp_level 3;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary on;
#重点区与server{}中的处理php应用到的
upstream server_mango {
server 127.0.0.1:9000;
}
#加载vhost下的.conf后缀所有文件
include /usr/local/nginx/conf/vhost/*.conf;
}
配置laravel的nginx站点的更多相关文章
- laravel的nginx配置
最近阅读laravel官方文档 发现了关于nginx的推荐配置 Nginx 如果你使用 Nginx ,在你的网站配置中加入下述代码将会转发所有的请求到 index.php 前端控制器. locatio ...
- Linux7下配置Nginx站点.
今天闲来无事,把服务器重新配置了一下,作为开发者,实际上很多人都是长时间不去配置服务器的,所以曾经很多东西又忘掉了差不多. 特在此分享一下配置成功后的配置文件内容. 其实配置后的文件内容很简单,也没有 ...
- Nginx 核心配置-新建一个web站点
Nginx 核心配置-新建一个web站点 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Nginx基础配置常用参数说明 [root@node101.yinzhengjie.or ...
- 使用宝塔配置laravel站点时,遇到open_basedir restriction in effect. 原因与解决方法
今天一位朋友在linux服务器部署thinkphp5的时候PHP报了这个错误,如下: Warning: require(): open_basedir restriction in effect. F ...
- 配置apache和nginx的tomcat负载均衡
概述 本篇文章主要介绍apache和nginx的相关配置,tomcat的相关安装配置我在前面有写过一篇,详细介绍通过两种配置方法配置nginx. tomcat配置参考:http://www.cnblo ...
- CentOS 6.5 yum安装配置lnmp服务器(Nginx+PHP+MySQL)
以下全部转载于 http://blog.csdn.net/lane_l/article/details/20235909 本人于今晚按照该文章使用centos 6.7 64bit安装成功,做个备份, ...
- tomcat相关配置技巧梳理 (修改站点目录、多项目部署、限制ip访问、大文件上传超时等)
tomcat常用架构:1)nginx+tomcat:即前端放一台nginx,然后通过nginx反向代理到tomcat端口(可参考:分享一例测试环境下nginx+tomcat的视频业务部署记录)2)to ...
- 阿里云服务器ecs配置之安装nginx
一.简介 Nginx是一款轻量级的网页服务器.反向代理服务器.相较于Apache.lighttpd具有占有内存少,稳定性高等优势.它最常的用途是提供反向代理服务. 二 .安装 1.准备工作 Nginx ...
- Linux yum的配置 , python环境管理, nginx搭建简单学习
Linux yum的配置 , python环境管理, nginx搭建简单学习 一丶配置yum的数据仓库 ### yum 工具, 方便,自行解决软件之间的依赖关系. # 配置yum源仓库 (可以使用,清 ...
随机推荐
- selenium2设置浏览器窗口
1.窗口最大化 //设置窗口最大化driver.manage().window().maximize(); 2.指定设置窗口大小 //指定呀设置窗口的宽度为:800,高度为600Dimension d ...
- 在python中对元祖进行排序
在python里你可以对一个元组进行排序.例子是最好的说明: >>> items = [(1, 'B'), (1, 'A'), (2, 'A'), (0, 'B'), (0, 'a' ...
- Hive学习笔记(四)-- hive的桶表
桶表抽样查询 查看hdfs上对应的文件内容 一个两个桶,第一个桶和第三个桶的数据 task = 4 4 / 2 = 2,一共是两个桶 第1个桶,第1+2个桶
- 哪里是Maven的中央存储库?
当你建立了一个Maven工程,Maven会检查你的pom.xml文件,确定要下载的依赖.首先,Maven将从您的本地库Maven查找,如果没有找到,Maven会从中央存储库-http://repo1. ...
- loj2001 「SDOI2017」树点涂色
there #include <iostream> #include <cstdio> using namespace std; int n, m, dfn[100005], ...
- Nginx从入门到放弃-第3章 场景实战篇
3-1场景实践篇内容介绍: 3-2 Nginx作为静态资源Web服务_静态资源类型: 3-3 Nginx作为静态资源web服务_CDN(内容分发网络)场景: 3-4 Nginx作为静态资源Web服务_ ...
- rsa Round #71 (Div. 2 only)
Replace A Time limit: 1000 msMemory limit: 256 MB You are given a string SS containing only letter ...
- rabbitmq exchange type
This is the fourth installment to the series: RabbitMQ for Windows. In thelast installment, we revi ...
- Hadoop High Availability
Hadoop High Availability HA(High Available), 高可用,是保证业务连续性的有效解决方案, 通常通过设置备用节点的方式实现; 一般分为执行业务的称为活动节点(A ...
- [USACO Section 2.1]城堡 The Castle (搜索)
题目链接 Solution 比较恶心的搜索,思路很简单,直接广搜找联通块即可. 但是细节很多,要注意的地方很多.所以直接看代码吧... Code #include<bits/stdc++.h&g ...