此份参考自网络:

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. codevs——T1860 最大数||洛谷——P1107 最大整数

    http://codevs.cn/problem/1860/ || https://www.luogu.org/problem/show?pid=1107#sub 题目描述 Description 设 ...

  2. [Bzoj3206][Apio2013]道路费用(kruscal)(缩点)

    3206: [Apio2013]道路费用 Time Limit: 20 Sec  Memory Limit: 128 MBSubmit: 536  Solved: 252[Submit][Status ...

  3. hadoop学习 的yarn

    Yarn的产生 mapReduc1.0 1单点故障 2扩展效率低 3资源利用率高 降低运维成本 方便数据共享 多计算框架支持 MapReduce Spark Storm Yarn的架构图 Yarn模块 ...

  4. Nginx配置文件语法教程

    Nginx的配置文件在一开始可能真的不太好理解,就像当初开始使用Apache那样,像JSON但却不是.可以说是Nginx的一种专门语言,仅为Nginx服务的. 市面上基本都是写了一点不写一点的教程,基 ...

  5. 微信小程序,不同的输入框显示

    <!--pages/index/Component/TextInput/TextInput.wxml--> <view class="viewTitle"> ...

  6. vSphere 6.5 新功能 (7) - 支持 512e 硬盘

    2016-12-11 Newton 长期以来,机械硬盘在储存数据时,一直都是以 512 byte 大小的扇区(Sector)为单位分割进行读写.随着硬盘容量的不断提升,这种古老的分配标准已经越来越不合 ...

  7. python requests接收chunked编码问题-python源码修改

    python requests接收chunked编码问题-python源码修改 学习了:https://blog.csdn.net/wangzuxi/article/details/40377467

  8. break 用法

    // break 在循环中的功能测试 # include <stdio.h> int main(void){ int i, j; for (i = 0; i<3; ++i) {  j ...

  9. Linux和Windows设备驱动架构比较

    毕业后一直在学操作系统, 有时候觉得什么都懂了,有时候又觉得好像什么都不懂,但总体来说自认为对操作系统实现机制的了解比周围的人还是要多一些.去年曾花了几个星期的晚上时间断断续续翻译了这篇对Linux和 ...

  10. mtk机型的一次救砖经历

    在recovery里清除了data,cache,system三个分区,没有刷机,重启到bootloader,准备另刷recovery. 有急事走开了,回来时发现手机黑屏,无论什么组合键都没反应,以为是 ...