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 · Oct 13, 2018 · 2525 views
    This topic created in 2850 days ago, the information mentioned may be changed or developed.

    我在一台服务器上装了 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 replies    2018-10-14 08:15:37 +08:00
    kslr
        1
    kslr  
       Oct 14, 2018
    这个问题很复杂,先研究下 cookie 参数
    noqwerty
        2
    noqwerty  
       Oct 14, 2018 via Android
    可以尝试一下在 nginx 里对你的 directadmin 登录路径设置不缓存? expires 0,改一下 cache-control header,然后直接 proxy_pass 到后端
    cxh116
        3
    cxh116  
       Oct 14, 2018 via Android
    有可能是端口不一致导致的,搜索 cp 反向代理 端口 方面的关键词,看能不能找到解决方案。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   978 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 22:57 · PVG 06:57 · LAX 15:57 · JFK 18:57
    ♥ Do have faith in what you're doing.