此份参考自网络:

server {
listen 80;
server_name laravel.app;
root /项目目录/public;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite; location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
} location ~ \.php {
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)/(.+)$ {
} location ~ /\.ht {
deny all;
}
}

此份参考自 Homestead【有修改】

server {
listen 80;
server_name xxx.com;
root "/项目目录/public";
index index.html index.htm index.php; # 无需用到 HTTPS 故注释
# listen 443 ssl http2;
# ssl_certificate /etc/nginx/ssl/xxx.com.crt;
# ssl_certificate_key /etc/nginx/ssl/xxx.com.key; charset utf-8; location / {
try_files $uri $uri/ /index.php?$query_string;
} location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; } access_log off;
# 日志,指定路径后可选开启。末尾值可选 error|notice|info
# error_log /var/log/nginx/xxx.com-error.log error;
sendfile off; client_max_body_size 100m; location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# 如果用到 sock 则值参考 unix:/var/run/php/php7.0-fpm.sock
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
include fastcgi_params;
} location ~ /\.ht {
deny all;
} }
百牛信息技术bainiu.ltd整理发布于博客园

Laravel 在 Nginx 中的参考配置两份的更多相关文章

  1. Nginx中虚拟主机配置

    一.Nginx中虚拟主机配置 1.基于域名的虚拟主机配置 1.修改宿主机的hosts文件(系统盘/windows/system32/driver/etc/HOSTS) linux : vim /etc ...

  2. 学习计划 nginx 中 php的配置详解

    本章只看一个刚下载的nginx是如何支持php的 -- location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_inde ...

  3. nginx中的超时配置

    nginx.conf配置文件中timeout超时时间设置 client_header_timeout 语法 client_header_timeout time默认值 60s上下文 http serv ...

  4. Nginx中的安全配置

    1.测试环境 操作系统:CentOS6.5 Web服务器:Nginx1.4.6 Php版本:Php5.4.26 2.Nginx介绍 1.nginx本身不能处理PHP,它只是个web服务器,当接收到请求 ...

  5. 编程技巧│超实用 nginx 中常见的配置合集

    目录 封禁 IP 仅开放内网 负载均衡 列出文件列表 路由转发 开启 gzip 压缩 解决跨域 资源防盗链 Keepalived 提高吞吐量 HTTP 强制跳转 HTTPS 封禁 IP 通过 deny ...

  6. Nginx中超时时间配置(转)

    本文介绍 Nginx 的 超时(timeout)配置.分享给大家,具体如下: Nginx 处理的每个请求均有相应的超时设置.如果做好这些超时时间的限定,判定超时后资源被释放,用来处理其他的请求,以此提 ...

  7. 网卡配置和DNS配置,手动挂在nas存储的共享目录,网络相关其它操作命令,修改防火墙中的端口配置,resolv.conf配置详细介绍和网卡信息配置详细介绍

    1.   网卡配置和DNS配置 若想服务器能够发邮件,需要让部署的服务器能够访问到外网环境.若部署的服务器访问不到外网,通过ping www.baidu.com的方式执行的时候,会出现以下问题: &q ...

  8. nginx 反向代理的配置

    nginx中的每个server就是一个反向代理配置,可以有多个server(nginx只能处理静态资源) nginx中 server的配置 server { listen 80; server_nam ...

  9. Last-Modified和ETag以及Apache和Nginx中的配置

    1) 什么是”Last-Modified”? 在浏览器第一次请求某一个URL时,服务器端的返回状态会是200,内容是你请求的资源,同时有一个Last-Modified的属性标记此文件在服务期端最后被修 ...

随机推荐

  1. T1079 回家 codevs

    http://codevs.cn/problem/1079/ 时间限制: 1 s  空间限制: 128000 KB  题目等级 : 白银 Silver~死坑 题目描述 Description 现在是晚 ...

  2. 模拟赛QAQ

    100 + 30 + 0 T1 叉叉 题目描述 现在有一个字符串,每个字母出现的次数均为偶数.接下来我们把第一次出现的字母a和第二次出现的a连一条线,第三次出现的和四次出现的字母a连一条线,第五次出现 ...

  3. Codeforces 123 E Maze

    Discription A maze is represented by a tree (an undirected graph, where exactly one way exists betwe ...

  4. JavaScript中判断变量类型最简洁的实现方法以及自动类型转换(#################################)

    这篇文章主要介绍了JavaScript中判断整字类型最简洁的实现方法,本文给出多个判断整数的方法,最后总结出一个最短.最简洁的实现方法,需要的朋友可以参考下 我们知道JavaScript提供了type ...

  5. ssh 卡主

    偶尔会遇到这样的现象 ssh 登录一台远程机器,显示下面的信息然后hang在那 Connecting to 192.168.137.102:22... Connection established. ...

  6. Halcon导出的cpp, VC++环境配置

    方式一: 1.project ->设置(Alt+F7) -> C/C++ ->分类:预处理器 ->附加包括路径   添加:$(HALCONROOT)/include,$(HAL ...

  7. C++常用字符串分割方法

    一.用strtok函数进行字符串分割 原型: char *strtok(char *str, const char *delim); 功能:分解字符串为一组字符串. 参数说明:str为要分解的字符串, ...

  8. Hash分析

    分析Hash 列表内容 Hash表中的一些原理/概念,及依据这些原理/概念,自己设计一个用来存放/查找数据的Hash表,而且与JDK中的HashMap类进行比較. 我们分一下七个步骤来进行. Hash ...

  9. SODBASE CEP学习(四)续:类SQL语言EPL与Storm或jStorm集成-使用分布式缓存

    流式计算在一些情况下会用到分布式缓存,从而实现(1)想把统计或计算结果保存在分布缓存中.供其他模块或其他系统调用. (2)某一滑动时间窗体上计数.比如实时统计1小时每一个Cookie的訪问量.实时统计 ...

  10. Vue 开发线路 资料 汇总

    线路 作者推荐学习线路 https://zhuanlan.zhihu.com/p/23134551 他人建议 https://www.cnblogs.com/smartXiang/p/6051086. ...