服务器 
首页 > 服务器 > 浏览文章

Laravel的Nginx重写规则实例代码

(编辑:jimmy 日期: 2024/10/19 浏览:3 次 )

laravel基本重写规则

location / {
    index index.html index.htm index.php;
    try_files $uri $uri/ /index.php"htmlcode">
if (!-d $request_filename)
{
   rewrite ^/(.+)/$ /$1 permanent;
}

去除index action

if ($request_uri ~* index/"htmlcode">
if (!-e $request_filename)
{
    rewrite ^/(.*)$ /index.php"htmlcode">
error_page 404 500 502 503 504 error.html;
location = error.html {
    root  html;
}

root是error文件的根目录

总结

以上所述是小编给大家介绍的Laravel的Nginx重写规则实例代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!

上一篇:CentOS添加和删除用户以及用户组的方法
下一篇:linux实现自动删除最旧的几个文件详解
几个月来,英特尔、微软、AMD和其它厂商都在共同推动“AI PC”的想法,朝着更多的AI功能迈进。在近日,英特尔在台北举行的开发者活动中,也宣布了关于AI PC加速计划、新的PC开发者计划和独立硬件供应商计划。
在此次发布会上,英特尔还发布了全新的全新的酷睿Ultra Meteor Lake NUC开发套件,以及联合微软等合作伙伴联合定义“AI PC”的定义标准。