Laravel Nginx配置步骤详解
发布:smiling 来源: PHP粉丝网 添加日期:2018-10-30 09:39:03 浏览: 评论:0
这是一个Laravel框架运行nginx服务器的配置示例,Laravel框架版本5.2.
- server {
- listen 80;
- server_name localhost;
- root /usr/share/nginx/html/tanteng.me/public;
- index index.php index.html index.htm;
- #charset koi8-r;
- #access_log /var/log/nginx/log/host.access.log main;
- location / {
- try_files $uri $uri/ /index.php?$query_string;
- }
- #error_page 404 /404.html;
- # redirect server error pages to the static page /50x.html
- #
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root /usr/share/nginx/html/tanteng.me/public;
- }
- # proxy the PHP scripts to Apache listening on 127.0.0.1:80
- #
- #location ~ \.php$ {
- # proxy_pass http://127.0.0.1;
- #}
- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
- #
- location ~ \.php$ {
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_index index.php;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- include fastcgi_params;
- }
- # deny access to .htaccess files, if Apache's document root
- # concurs with nginx's one
- #
- location ~ /\.ht {
- deny all;
- }
- }
运行在CentOS 7环境,Nginx版本1.8.
Tags: Laravel Nginx 配置步骤
- 上一篇:PHP编译安装后PHP-FPM使用笔记
- 下一篇:最后一页
相关文章
- ·Laravel4安装配置的方法(2014-08-25)
- ·Ubuntu上搭建PHP+Mysql+Nginx环境(2014-08-26)
推荐文章
热门文章
最新评论文章
- 写给考虑创业的年轻程序员(10)
- PHP新手上路(一)(7)
- 惹恼程序员的十件事(5)
- PHP邮件发送例子,已测试成功(5)
- 致初学者:PHP比ASP优秀的七个理由(4)
- PHP会被淘汰吗?(4)
- PHP新手上路(四)(4)
- 如何去学习PHP?(2)
- 简单入门级php分页代码(2)
- php中邮箱email 电话等格式的验证(2)