HOME/ 代码笔记/ No.10

Laravel Nginx 伪静态

代码笔记 约 1 分钟 0 条评论

Nginx 伪静态

server{
        #端口配置
        listen 80;
        #域名配置
        server_name laravel.cc;
        index index.php index.html index.htm;
        #站点配置到public
        root /data/wwwroot/laravel.cc/public;
      #日志记录
        access_log /data/logs/nginx.laravel.cc.log access;
        error_log /data/logs/nginx.laravel.cc.error debug;
     #静态文件配置
        location ~ .*\.(jpg|jpeg|gif|png|bmp|css|js|swf|txt|ttf|woff|ico)$ {
                expires 7d;
                break;
        }
        location / {
         #重点区
                try_files \$uri \$uri/ /index.php?$query_string;
                index index.php index.html index.htm;
        }
        #静态文件配置
        location /logs {
                autoindex on;
                autoindex_exact_size off;
                autoindex_localtime on;
                break;
        }
        #处理php配置
        location ~ "\.php$" {
                include fastcgi_params;
                fastcgi_index index.php;
                #在nginx.conf配置server_mango
                fastcgi_pass server_mango;
        }
}
发布于 2020-03-16

相关文章代码笔记

评论0

Reply · 发表评论

发表前会弹出人机验证与邮箱验证,邮箱不会公开。