[Blazor] Grafana DashBoard iframe URL http 로 가져오는 방법
- 웹 프로그래밍/Blazor
- 2023. 1. 6. 19:12
Blazor Http로 실행
- Blazor는 기본적으로 https, http 모두 실행되게 되어 있습니다.
- 아래는
LaunchSetting.json
입니다.
{
"profiles": {
"GrafanaIframeTest": {
"commandName": "Project",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"dotnetRunMessages": true,
"applicationUrl": "https://localhost:7051;http://localhost:5207"
}
}
- 위 JSON 파일에서
applicationUrl
을 보면https
와http
가 있습니다. - Blazor를 기본적으로 실행하면
https
로 접속하게 됩니다.
- 그래서 접속하면 아래와 같은 로그가 출력 됩니다.
Mixed Content: The page at 'https://localhost:49157/counter' was loaded over HTTPS, but requested an insecure frame 'http://192.168.70.34:3000/d/TAi1Zb7Vz/overview?orgId=1'. This request has been blocked; the content must be served over HTTPS.
LaunchSetting.json
에 적혀있는 http로 접속해봅니다.- http로 접속했지만 주소가 https로 그대로 입니다.
- 원인은 아래의 옵션으로 http로 접속하여도 https로 리다이랙션 되기 때문입니다.
- Programs에서 아래의 옵션을 제거 합니다.
app.UseHttpsRedirection();
- 위 옵션을 제거하고 실행 결과, 정상적으로 동작하는 것을 확인하였습니다.
정리
- Blazor와 Grafana는 둘 다 https이거나 http여야 합니다..(https <-> http는 불가능)
- Blazor에서 http로 접속하기 위해서는
app.UseHttpsRedirection();
설정을 삭제해야 합니다. - Blaozr 에서 Grafana https 로 접속하기 위해서는, Grafana 의 정보를 http -> https 로 변경해야만 합니다.
728x90
'웹 프로그래밍 > Blazor' 카테고리의 다른 글
[Blazor] Blazor MonacoEditor 사용방법 (0) | 2023.02.06 |
---|---|
[Blazor] iframe 태그 이용하여 grafana DashBaord HTTPS URL 불러오기 (0) | 2023.01.06 |
[Blazor] ToDoList 만들기 (0) | 2022.12.15 |
[Blazor] LocalStorage 사용법 (1) | 2022.12.10 |
[Blazor] JWT 예제 (0) | 2022.12.10 |
이 글을 공유하기