nginx 配置 laravel
来源:互联网 发布:linux 创建swap 编辑:程序博客网 时间:2024/06/16 03:51
server {
listen 80 ;
server_name laravel.com;
root /var/www/laravel/public;
index index.php index.html index.htm index.nginx-debian.html;
location / {
# 去除末尾的斜杠,SEO更加友好
if (!-d $request_filename)
{
rewrite ^/(.+)/$ /$1 permanent;
}
# 去除index action
if ($request_uri ~* index/?$)
{
rewrite ^/(.*)/index/?$ /$1 permanent;
}
# 根据laravel规则进行url重写
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
}
listen 80 ;
server_name laravel.com;
root /var/www/laravel/public;
index index.php index.html index.htm index.nginx-debian.html;
location / {
root /var/www/laravel/public;
# 路由规则 分页传参用到
try_files $uri $uri/ /index.php?$query_string;# 去除末尾的斜杠,SEO更加友好
if (!-d $request_filename)
{
rewrite ^/(.+)/$ /$1 permanent;
}
# 去除index action
if ($request_uri ~* index/?$)
{
rewrite ^/(.*)/index/?$ /$1 permanent;
}
# 根据laravel规则进行url重写
if (!-e $request_filename)
{
rewrite ^/(.*)$ /index.php?/$1 last;
break;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
# With php5-cgi alone:
#fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
}
}
0 0
- Nginx Laravel alias配置
- Laravel的Nginx配置
- laravel nginx 配置
- laravel 在nginx配置
- laravel nginx配置
- laravel nginx配置
- Laravel配置nginx环境
- nginx配置laravel
- nginx 配置 laravel
- nginx 配置 laravel
- nginx配置Laravel
- Laravel配置nginx环境
- Nginx运行Laravel的配置
- Laravel 5.2配置Nginx服务器
- laravel 5.2 nginx 服务器配置
- 我的laravel nginx配置
- nginx的通用配置 和laravel 配置
- ubuntu_14.04.2安装配置laravel+nginx
- 【Leetcode】424. Longest Repeating Character Replacement
- git upload
- Unity3D 5.X 新版AssetBundle使用方案及策略
- 每位开发人员都应铭记的10句编程谚语
- activiti工作流的web流程设计器整合视频教程 SSM和独立部署
- nginx 配置 laravel
- React-Native 之ListView
- 数据结构-并查集
- 解析Xcode项目文件中的project.pbxproj:Object-C实现
- CSS的选择器分类
- Java学习笔记之数据类型和流程控制
- 《Python Web开发实战》踩地雷记17/3/22
- hanoi塔 python
- 还原二叉树