Skip to content
This repository has been archived by the owner on May 18, 2024. It is now read-only.

使用Nginx代理后无法登陆后台. #329

Closed
Duhonghao opened this issue Dec 26, 2017 · 2 comments
Closed

使用Nginx代理后无法登陆后台. #329

Duhonghao opened this issue Dec 26, 2017 · 2 comments

Comments

@Duhonghao
Copy link

Duhonghao commented Dec 26, 2017

作者好,

谢谢你开源这么棒的产品,但 我在使用过程中遇到一些问题,请您有时间的情况下帮忙看一下是否为bug.

环境:Linux centos + Nginx + +SSL + Tale

Tale在本地以9000端口运行服务,

Nginx配置如下:

server {
  listen 80;
  listen 443 ssl http2;
  ssl_certificate /usr/local/nginx/conf/ssl/www.markthis.cn.crt;
  ssl_certificate_key /usr/local/nginx/conf/ssl/www.markthis.cn.key;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers EECDH+CHACHA20:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  ssl_prefer_server_ciphers on;
  ssl_session_timeout 10m;
  ssl_session_cache builtin:1000 shared:SSL:10m;
  ssl_buffer_size 1400;
  add_header Strict-Transport-Security max-age=15768000;
  ssl_stapling on;
  ssl_stapling_verify on;
  server_name www.markthis.cn markthis.cn;
  access_log /data/wwwlogs/www.markthis.cn_nginx.log combined;
  root /data/wwwroot/www.markthis.cn;
  if ($ssl_protocol = "") { return 301 https://$host$request_uri; }
  if ($host != www.markthis.cn) {  return 301 $scheme://www.markthis.cn$request_uri;  }

  proxy_set_header X-Forwarded-Server $host; 
  proxy_set_header X-Forwarded-Server $proxy_add_x_forwarded_for; 
  
proxy_set_header Host $host; 
location / {
        proxy_pass http://127.0.0.1:9000;
        proxy_connect_timeout 600;
proxy_read_timeout 600;     
}  
}

但是这样的话,在admin登陆的时候,就无线循环到登陆页面,无法登陆成功,

但是若以HTTP://IP:9000 的方式登陆,则可以顺利完成.

@hellokaton
Copy link
Member

感谢你的反馈,你尝试升级一下 tale,命令是:

./tale-cli upgrade

原因是 mvc 框架其中有一个版本的无法读取 header 名为小写 cookie,在部分 nginx 下是有这种情况的,我也遇到过一次,看样子你也使用了一键脚本 :P

@Duhonghao
Copy link
Author

Bingo ,

我确实是使用了oneinstack的一键安装脚本,

经过您的建议后确实已经生效了,感谢帮助,

祝项目越做越好.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants