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站点的更多相关文章

  1. laravel的nginx配置

    最近阅读laravel官方文档 发现了关于nginx的推荐配置 Nginx 如果你使用 Nginx ,在你的网站配置中加入下述代码将会转发所有的请求到 index.php 前端控制器. locatio ...

  2. Linux7下配置Nginx站点.

    今天闲来无事,把服务器重新配置了一下,作为开发者,实际上很多人都是长时间不去配置服务器的,所以曾经很多东西又忘掉了差不多. 特在此分享一下配置成功后的配置文件内容. 其实配置后的文件内容很简单,也没有 ...

  3. Nginx 核心配置-新建一个web站点

    Nginx 核心配置-新建一个web站点 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.Nginx基础配置常用参数说明 [root@node101.yinzhengjie.or ...

  4. 使用宝塔配置laravel站点时,遇到open_basedir restriction in effect. 原因与解决方法

    今天一位朋友在linux服务器部署thinkphp5的时候PHP报了这个错误,如下: Warning: require(): open_basedir restriction in effect. F ...

  5. 配置apache和nginx的tomcat负载均衡

    概述 本篇文章主要介绍apache和nginx的相关配置,tomcat的相关安装配置我在前面有写过一篇,详细介绍通过两种配置方法配置nginx. tomcat配置参考:http://www.cnblo ...

  6. CentOS 6.5 yum安装配置lnmp服务器(Nginx+PHP+MySQL)

    以下全部转载于  http://blog.csdn.net/lane_l/article/details/20235909 本人于今晚按照该文章使用centos 6.7 64bit安装成功,做个备份, ...

  7. tomcat相关配置技巧梳理 (修改站点目录、多项目部署、限制ip访问、大文件上传超时等)

    tomcat常用架构:1)nginx+tomcat:即前端放一台nginx,然后通过nginx反向代理到tomcat端口(可参考:分享一例测试环境下nginx+tomcat的视频业务部署记录)2)to ...

  8. 阿里云服务器ecs配置之安装nginx

    一.简介 Nginx是一款轻量级的网页服务器.反向代理服务器.相较于Apache.lighttpd具有占有内存少,稳定性高等优势.它最常的用途是提供反向代理服务. 二 .安装 1.准备工作 Nginx ...

  9. Linux yum的配置 , python环境管理, nginx搭建简单学习

    Linux yum的配置 , python环境管理, nginx搭建简单学习 一丶配置yum的数据仓库 ### yum 工具, 方便,自行解决软件之间的依赖关系. # 配置yum源仓库 (可以使用,清 ...

随机推荐

  1. LeetCode(225) Implement Stack using Queues

    题目 Implement the following operations of a stack using queues. push(x) – Push element x onto stack. ...

  2. LeetCode(282) Peeking Iterator

    题目 Given an Iterator class interface with methods: next() and hasNext(), design and implement a Peek ...

  3. hdu 5984

    PockyTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submissio ...

  4. debian软raid

    http://www.linuxidc.com/Linux/2013-06/86487.htm  

  5. loj2014 「SCOI2016」萌萌哒

    神tm st表+并查集 #include <iostream> #include <cstdio> #include <cmath> using namespace ...

  6. Linux中的more命令

    ore命令,功能类似 cat , cat命令是整个文件的内容从上到下显示在屏幕上.  more会以一页一页的显示方便使用者逐页阅读,而最基本的指令就是按空白键(space)就往下一页显示,而且还有搜寻 ...

  7. Collection类及常用API

    Collection类及常用API Collection—类集工具类,定义了若干用于类集和映射的算法,这些算法被定义为静态方法,具体查看api文档; a)  public static void so ...

  8. PTA 10-排序6 Sort with Swap(0, i) (25分)

    题目地址 https://pta.patest.cn/pta/test/16/exam/4/question/678 5-16 Sort with Swap(0, i)   (25分) Given a ...

  9. DS博客作业-05--树

    1.本周学习总结  1.1思维导图  1.2学习体会 1.课堂上的知识也很难听懂,打代码就更难听懂了,真的需要不断练习代码. 2.在学习本章的内容中,一开始只是理解了概念,在真正做题中,一点思路都没有 ...

  10. 【bzoj3676】[Apio2014]回文串 回文自动机

    题目描述 考虑一个只包含小写拉丁字母的字符串s.我们定义s的一个子串t的“出现值”为t在s中的出现次数乘以t的长度.请你求出s的所有回文子串中的最大出现值. 输入 输入只有一行,为一个只包含小写字母( ...