그누보드6 실서버 배포 후 채택완료
Copy
Mixed Content: The page at 'https://도메인/board/write/main_product/1?page=2' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://도메인/editor/ckeditor4/upload?type=Images&responseType=json'. This request has been blocked; the content must be served over HTTPS.
안녕하세요.
AWS lightsail, ubuntu를 이용해 기존에 갖고 있던 도메인을 연결하여 배포하였습니다.
nginx를 이용하여 설정을 완료하였고, 팁자료실에 올려 주신 nginx ssl 인증서 생성 방법도 따라 하였습니다.
도메인이 https로 잘 연결이 되지만,
admin이나 게시판 form의 업로드나, submit 버튼을 누르면 이런 식으로 http endpoint로 가는 것 같은데, 혹시 어떻게 하면 이것을 해결할 수 있을지 알 수 있을까요?
셀프 해결했습니다. main.py의 BaseSchemeMiddleware을 아래와 같이 수정했습니다.
Copy
request.scope["scheme"] = request.headers.get("X-Forwarded-Proto", "https")
답변 2개
1년 전
ㅎㅎ 덕분에 https 부분 해결 되였습니다.
허나 현재는
core > middleware.py 맨 하단에 있습니다.
Copy
class BaseSchemeMiddleware(BaseHTTPMiddleware):
async def dispatch(self, request: Request, call_next):
# X-Forwarded-Proto 헤더를 통해 클라이언트가 사용하는 실제 프로토콜을 결정합니다.
request.scope["scheme"] = request.headers.get("X-Forwarded-Proto", "http")
return await call_next(request)
로그인 후 평가할 수 있습니다
답변에 대한 댓글 2개
댓글을 작성하려면 로그인이 필요합니다.
답변에 대한 댓글 1개
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인