搜索
系统检测到您的用户名不符合规范:

thinkphp5.1 nginx下配置问题

浏览:3865 发布日期:2019年05月30日 分类:求助交流 关键字: thinkphp5.1 nginx
开发的系统部署到nginx之后,可以打开页面,但是页面引用的css,js文件路径都是错误的,路径都加了index.php。不知道该怎么配置nginx.conf。这个配置使用thinkphp5.0的项目是没有问题的。求教,实在对nginx的配置不懂 server {
listen 80;
server_name _ ;
#ssl on;
#ssl_certificate /etc/pki/tls/certs/localhost.crt;
#ssl_certificate_key /etc/pki/tls/certs/server.key;

access_log /data/wwwlogs/access_nginx.log combined;
root /data/wwwroot/default/;
index index.html index.htm index.php;
#error_page 404 /404.html;
#error_page 502 /502.html;
location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
error_page 405 =200 @405;


location @405
{
root /data/wwwroot/default;
}
location ~ [^/]\.php(/|$) {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
fastcgi_index index.php;
include fastcgi.conf;
client_max_body_size 500m;
#rewrite ^/(.*)$ /index.php/?s=1ドル last;
}
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;
}
}
最佳答案
评论() 相关
后面还有条评论,
评论支持使用[code][/code]标签添加代码
您需要登录后才可以评论 登录 | 立即注册
收藏
lippor
积分:600 等级:LV2
热点推荐
(追記) (追記ここまで)
最新更新

我们

合作

网站

信息

ThinkPHP 是一个免费开源的,快速、简单的面向对象的 轻量级PHP开发框架 ,创立于2006年初,遵循Apache2开源协议发布,是为了敏捷WEB应用开发和简化企业应用开发而诞生的。ThinkPHP从诞生以来一直秉承简洁实用的设计原则,在保持出色的性能和至简的代码的同时,也注重易用性。并且拥有众多的原创功能和特性,在社区团队的积极参与下,在易用性、扩展性和性能方面不断优化和改进,已经成长为国内最领先和最具影响力的WEB应用开发框架,众多的典型案例确保可以稳定用于商业以及门户级的开发。

AltStyle によって変換されたページ (->オリジナル) /