V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
noobsj
V2EX  ›  NGINX

关于 directadmin 服务器设置 cloudflare CDN 的问题

  •  
  •   noobsj · 2018-10-13 22:57:58 +08:00 · 1933 次点击
    这是一个创建于 1992 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我在一台服务器上装了 directadmin,想用 cloudflare CDN 来隐藏真实 ip,所以我使用了 nginx 反代来和 directadmin 服务器通信(已经把 directadmin 的 apache 替换成了 nginx ),nginx 配置如下

    server {
       listen 我服务器 IP:80;
       server_name cp.domain.com;
    
       include /etc/nginx/webapps.conf;
    
       location / {
           proxy_pass       http://127.0.0.1:2222/;
           proxy_set_header Host $host;
           proxy_set_header X-Real-IP $remote_addr;
           proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
           proxy_redirect http://cp.domain.com:2222/ http://cp.domain.com/;
       }
    }
    

    结果每次在 directadmin 登录页面,成功登录后,随便点击页面链接,就又跳转到登录页面,让重新输入账号密码,谁遇到过这个问题吗

    3 条回复    2018-10-14 08:15:37 +08:00
    kslr
        1
    kslr  
       2018-10-14 00:32:31 +08:00
    这个问题很复杂,先研究下 cookie 参数
    noqwerty
        2
    noqwerty  
       2018-10-14 07:01:05 +08:00 via Android
    可以尝试一下在 nginx 里对你的 directadmin 登录路径设置不缓存? expires 0,改一下 cache-control header,然后直接 proxy_pass 到后端
    cxh116
        3
    cxh116  
       2018-10-14 08:15:37 +08:00 via Android
    有可能是端口不一致导致的,搜索 cp 反向代理 端口 方面的关键词,看能不能找到解决方案。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5431 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 08:46 · PVG 16:46 · LAX 01:46 · JFK 04:46
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.