Hackxiaoya / CuteOne

这大概是最好的onedrive挂载程序了吧,我猜。
http://demo.cuteone.cn
834 stars 198 forks source link

求助下,反代出现问题,管理页面总是跳转到127.0.0.1:5000 #59

Open SCGabriel opened 5 years ago

SCGabriel commented 5 years ago

用nginx做的反代,但是反代完之后访问网址没有问题,但是进/admin/ 的时候,每次在页面里点击一个选项,都会被强制跳转到127.0.0.1:5000上,附上nginx配置文件,请大佬看下是什么问题

server
    {
        listen 80;
        #listen [::]:80;
        server_name xx.xxx.com ;

    return 301 https://$server_name$request_uri;

        access_log  /home/wwwlogs/CuteOne.log;
    }

server
    {
        listen 443 ssl http2;
        #listen [::]:443 ssl http2;
        server_name xx.xxx.com ;

        ssl_certificate /usr/local/nginx/conf/ssl/xx.xxx.com/fullchain.cer;
        ssl_certificate_key /usr/local/nginx/conf/ssl/xx.xxx.com/xx.xxx.com.key;
        ssl_session_timeout 5m;
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
        ssl_prefer_server_ciphers on;
        ssl_ciphers "TLS13-AES-256-GCM-SHA384:TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-128-CCM-8-SHA256:TLS13-AES-128-CCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5";
        ssl_session_cache builtin:1000 shared:SSL:10m;
        # openssl dhparam -out /usr/local/nginx/conf/ssl/dhparam.pem 2048
        ssl_dhparam /usr/local/nginx/conf/ssl/dhparam.pem;

        include rewrite/other.conf;
        #error_page   404   /404.html;

        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }

        include enable-php-pathinfo.conf;

    location / {
        proxy_pass http://127.0.0.1:5000;
        proxy_redirect off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    }

        access_log  /home/wwwlogs/CuteOne.log;
    }
SCGabriel commented 5 years ago

更新下,咱改成这样就OK了,供后人参考

location / {
                proxy_pass http://127.0.0.1:5000;
                proxy_set_header      Host $http_host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header      REMOTE-HOST $remote_addr;

                proxy_buffering off;
                proxy_cache off;
                proxy_set_header X-Forwarded-Proto $scheme;
        }