Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

blog 和admin 前端 API 502 #183

Open
mkersonJ opened this issue Dec 31, 2024 · 0 comments
Open

blog 和admin 前端 API 502 #183

mkersonJ opened this issue Dec 31, 2024 · 0 comments

Comments

@mkersonJ
Copy link

后端使用IP:8080,显示20000,但是无论blog还是admin都无法连接后端,显示 API 502 bad Gateway,

blog: Request URL:
https://doc.netheart.xyz/api/comments/topSix
Request Method:
GET
Status Code:
502 Bad Gateway
Remote Address:
[2606:4700:3030::ac43:935e]:443

admin:Request URL:
https://admin.netheart.xyz/api/users/login
Request Method:
POST
Status Code:
502 Bad Gateway
Remote Address:
127.0.0.1:7890
Referrer Policy:
strict-origin-when-cross-origin
}

我的nginx:
location ^~ /api/ {
proxy_pass http://doc.netheart.xyz:8080/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}

}

server {
listen 443 ssl;
server_name admin.netheart.xyz;

    ssl_certificate    /etc/ssl/certs/admin.netheart.xyz.pem;
    ssl_certificate_key  /etc/ssl/certs/admin.netheart.xyz.key;
    ssl_session_timeout 5m;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

   location / {
        root   /usr/local/aurora-vue/admin;
        index  index.html index.htm;
        try_files $uri $uri/ /index.html;
    }

    location ^~ /api/ {
        proxy_pass http://admin.netheart.xyz:8080/;
        proxy_set_header   Host             $host;
        proxy_set_header   X-Real-IP        $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
    }

}

我的 blog vue.config.js
devServer: {
chunkSizeWarningLimit: 1600,
proxy: {
'/api': {
target: 'https://www.linhaojun.top/api/',_
changeOrigin: true,
pathRewrite: {
'^/api': ''
}
}
}
},

我已经对nginx 的proxy pass 换成自己的IP抑或是域名,都不行,同样也对 admin 和blog 的vue.config.js. api target 设置为自己的域名和IP,包括添加8080 端口,也不行,

我开放的端口如下:8080,80,443,3306,5601.。9200。等也不行

Screenshot 2024-12-30 at 7 39 18 PM Screenshot 2024-12-30 at 7 39 36 PM

Need Help!!!

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

No branches or pull requests

1 participant