nginx 下php项目登录时总是302重定向,该如何解决?或者该如何配置?急!

有梦想的 2018-05-04 10:06:10
网站:http://www.ihaveyou.net/user/login.html

账号:nihaoma
密码:nihaoma
验证码随便输
我在我本地wamp环境是没有问题的,
但是再nginx上一登录就会302重定向到/user/login.html这个界面。
我的配置文件该如何配置呢?
这是我的配置文件:
server {
listen 80;
server_name www.ihaveyou.net ihaveyou.net;
root /usr/share/nginx/html/elevator;
index index.php;

charset utf-8;

access_log /var/log/nginx/host.access.log main;
error_log /var/log/nginx/error.log;

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9001


location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
#去掉index.php
location / { if (!-e $request_filename){ rewrite ^/(.*)$ /index.php/$1 last; }}


# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
location ~ /\.ht {
deny all;
}
}


求解答为什么会一直302
...全文
2642 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
好人二狗 2018-05-09
  • 打赏
  • 举报
回复
说实话我没有看到表单你提交到哪里去了,在表单的属性里 action 是指向哪的?检查那个方法,代码里是不是写了header(location:'user/login')
李睿_Lee 2018-05-08
  • 打赏
  • 举报
回复
Nginx配置里没有302到login的,所以不是这个问题。查查代码去吧。
木秀猿林 2018-05-08
  • 打赏
  • 举报
回复
看下你验证登陆的代码看看吧!是不是后台直接登陆失败然后跳转登陆界面了
一生小白 2018-05-08
  • 打赏
  • 举报
回复
原因在,处理表单提交的代码里
伟洪winni 2018-05-05
  • 打赏
  • 举报
回复
有梦想的 2018-05-04
  • 打赏
  • 举报
回复


点击登录之后,没有请求到company.html这个页面 被重定向了

21,890

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧