博客系统中SkyWalking跨域问题的解决方案 - skywalking:
SkyWalking是一个分布式跟踪系统,用于收集和分析应用程序的性能数据。在博客系统中使用SkyWalking时,可能会遇到跨域问题。以下是一些解决方案:
skywalking.yaml
global:
skywalking:
enabled: true
# 其他配置项...
collector:
skywalking:
enabled: true
# 其他配置项...
dashboard:
skywalking:
enabled: true
# 其他配置项...
X-SKYWALKING-SERVERapplication.propertiesapplication.yml
server.servlet.context-path=/your-blog-path
spring.http.cors.enabled=true
spring.http.cors.allowed-origins=*
spring.http.cors.allowed-methods=GET, POST, PUT, DELETE, OPTIONS
spring.http.cors.allowed-headers=Content-Type, Authorization, X-Requested-With, X-SKYWALKING-SERVER
async: falsecrossDomain: true
$.ajax({
url: 'https://your-blog-url',
type: 'GET',
async: false,
crossDomain: true,
// 其他配置项...
});
ConnectionManageruseUnsafeProtocoltrue 拼多多帮助力入口
CloseableHttpClient httpClient = HttpClients.custom()
.setSSLHostnameVerifier(new HostnameVerifier() {
public boolean verify(String hostname, SSLSession session) {
return true;
}
})
.build();
proxy_set_header
location /your-blog-path {
# 其他配置项...
proxy_set_header X-SKYWALKING-SERVER $http_x_sskywalking_server;
}
通过以上方法,应该可以解决博客系统中SkyWalking跨域问题。