tp5静态文件不能加载
来源:3-3 TP5神器-webserver-

慕粉15031226078
2019-04-01
老师你好,我的问题还是没有解决
样式加载不了 而且还
2回答
-
慕粉15031226078
提问者
2019-04-01
server {
#listen 80;
server_name thinkphp5.com;
root /usr/local/var/www/mycode/thinkphp5/public;
access_log off;
location / {
index index.html index.htm index.php;
#autoindex on;
#include /usr/local/etc/nginx/php-fpm;
}
#如果请求既不是一个文件,也不是一个目录,则执行一下重写规则
if (!-e $request_filename) {
#地址作为将参数rewrite到index.php上。
#rewrite ^/(.*)$ /index.php/$1;
#若是子目录则使用下面这句,将subdir改成目录名称即可。
#rewrite ^/subdir/(.*)$ /subdir/index.php/$1;
rewrite ^/(.*)$ /index.php?s=/$1 last;
break;
}
location ~\.php$ {
#try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
#fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass 127.0.0.1:9000;
#fastcgi_pass unix:/run/php/php7.1-fpm.sock;
}
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf|flv|mp4|ico)$ {
expires 30d;
access_log off;
}
location ~ .*\.(js|css)?$ {
expires 7d;
access_log off;
}
location ~ /\.ht {
deny all;
}
}
012019-04-01 -
singwa
2019-04-01
亲爱的同学,这个很可能是您的web服务器配置有问题。你可以从web服务器配置 那边查看下。
你是apache还是nginx呢?
042019-04-03
相似问题