繁体   English   中英

yii2高级模板:登录导致无限重定向循环

[英]yii2 advanced template: logging in causes inifinite redirect loop

我已经完成并将yii2项目(高级模板)上传到托管(在nginx 1.4.4上运行)。 现在,当我要登录到管理后端并输入登录名/密码时,它将启动无限重定向循环。 在我的本地服务器中,它不会表现出这种行为。

我上网冲浪,但找不到任何答案。 希望有人面对这样的情况并能够弄清楚问题出在哪里。

一些细节:

服务器:nginx 1.4.4; X-可缓存:是还启用了清漆。

如有必要,我可以提供更多信息。

您应该将应用程序分为两部分。 分开保持前端会话和后端会话。 并阅读本指南。 推荐的Nginx配置http://www.yiiframework.com/doc-2.0/guide-start-installation.html

 server { charset utf-8; client_max_body_size 128M; listen 80; ## listen for ipv4 #listen [::]:80 default_server ipv6only=on; ## listen for ipv6 server_name mysite.local; root /path/to/basic/web; index index.php; access_log /path/to/basic/log/access.log; error_log /path/to/basic/log/error.log; location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri/ /index.php?$args; } # uncomment to avoid processing of calls to non-existing static files by Yii #location ~ \\.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ { # try_files $uri =404; #} #error_page 404 /404.html; location ~ \\.php$ { include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; #fastcgi_pass unix:/var/run/php5-fpm.sock; try_files $uri =404; } location ~ /\\.(ht|svn|git) { deny all; } } 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM