两个域名解析到同一个ip,一个正常访问一个http521

我有两个域名,xxxxA和xxxB
各自解析两个子域名
testapi.xxxxA和 testapi.xxxxB.com到同一个ip地址52.xxx.xxx.xxx
其中testapi.xxxxA可以正常访问,但是testapi.xxxxB
返回521的错误代码
服务器的nginx已经做了正确的解析

server {
        listen 80;
        server_name testapi.xxxxA testapi.xxxxB;

        location ^~/trans/{
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_redirect off;
             proxy_read_timeout 600;
             proxy_connect_timeout 600;
             rewrite ^/trans/(.*)$ /$1 break;
             proxy_pass http://127.0.0.1:8890;
        }



        location / {
             proxy_set_header X-Real-IP $remote_addr;
             proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
             proxy_redirect off;
             proxy_read_timeout 600;
             proxy_connect_timeout 600;
             proxy_pass http://127.0.0.1:8889;
}
}

Your server does not seem to be configured for HTTPS. That will be why Cloudflare cannot connect. Make sure your server is properly configured for HTTPS and has a valid certificate and it should work.

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.