配置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源仓库 (可以使用,清 ...
随机推荐
- STM32HAL学习博客
https://www.cnblogs.com/wt88/category/1297945.html
- stm32之Cortex系统定时器(SysTick)
转载自:http://www.21ic.com/app/mcu/201811/781135.htm SysTick时钟,俗称“嘀嗒定时器”,它能按设定的时间产生一次中断.控制工程代码中随处可见形如 ...
- Linux压缩与归档
文件的压缩 aaaaaabbbbccc压缩成为6a4b3c 压缩工具: gzip/gunzip: .gz后缀 只能压缩文件,不能压缩目录,因其不具备归档功能 ...
- Monkeyrunner 简介及其环境搭建
Monkeyrunner是通过坐标.控件ID和控件上的文字操作应用的界面元素,其测试用例是用python写的,这样就弥补了monkey只有简单命令无法执行复杂用例的缺陷.Monkeyrunner采用的 ...
- Selenium WebDriver-判断页面中某一元素是否已经显示,通常用于断言
判断界面中某一元素是否已经呈现,多用于断言,代码如下: #encoding=utf-8 import unittest import time from selenium import webdriv ...
- 《Python全栈开发指南》第3版 Alex著(LFXC2018)
第一章 Python基础——Python介绍&循环语句 1.1 编程语言介绍 1.2 Python介绍 1.3 Python安装 1.4 第一个Python程序 1.5 变量 1.6 程序交互 ...
- Nginx从入门到放弃-第2章 基础篇
2-1 什么是Nginx 2-2 常见的中间件服务 2-3 Nginx的特性_实现优点1 2-4 Nginx特性_实现优点2 2-5 Nginx特性_实现优点3 2-6 Nginx特性_实现优点4 2 ...
- TensorFlow——热身运动:简单的线性回归
过程: 先用numpy建立100个数据点,再用梯度下滑工具来拟合,得到完美的回归线. # _*_coding:utf-8_*_ import tensorflow as tf import numpy ...
- [python工具][1]sublime安装与配置
http://www.cnblogs.com/wind128/p/4409422.html 1 官网下载版本 http://www.sublimetext.com/3 选择 Windows - al ...
- TOJ4277: Sequence 组合数学
4277: Sequence Time Limit(Common/Java):2000MS/6000MS Memory Limit:65536KByte Total Submit: 39 ...