Quantcast
Channel: Active questions tagged https - Stack Overflow
Viewing all articles
Browse latest Browse all 1585

Switched from HTTPS to HTTP, but still getting 'should be served over HTTPS' error (NAS + NGINX + Cafe24 DNS)

$
0
0

I have a domain which was previously served via HTTPS on a Node.js environment. However, I had to remove SSL because Node.js hosting on Cafe24(Korean web hosting service like cloudflare) doesn't allow installing a custom SSL certificate. So I switched everything to plain HTTP.

Here’s my current setup:

  1. Domain / DNS:

    • The domain is managed by Cafe24’s name servers.
    • The A record points to my NAS server’s public IP.
  2. NAS (NGINX) Configuration:

    • I removed all HTTPS/SSL settings from NGINX (deleted listen 443 ssl; blocks, removed any ssl_certificate references, etc.).
    • NGINX now only listens on port 80.
    • Verified that my service 'http://~~~' does serve a page properly.
  3. Problem:

    • I use html2pdf.js in my web app to convert HTML to PDF.

    • When running on my website, I see an error in the browser console:

      The file at 'blob:`mywebsiteURL`/d94c0187-ab23-442a-9f1b-b44ce05efdcb'was loaded over an insecure connection. This file should be served over HTTPS.

The code below is related code. As you can see,this code is about making html file to pdf which is in 'popup-content-area'.

<body><div class="popup_container"><!-- Toolbar --><div class="toolbar"><button id="pdf-convert-button"><i class="ph ph-file-pdf" size="24"></i></button><button id="save-button"><i class="ph ph-floppy-disk" size="24"></i></button><button class="close_button" id="popup-close-button" size="24"><i class="ph ph-x"></i></button></div><!-- Popup Content --><div id="popup-content-area" contenteditable="true"></div></div><script>    // HTML 파일로드함수    async function loadHTMLContent(url) {        try {            const response = await fetch(url); // HTML 파일요청            if (!response.ok) throw new Error("HTTP 오류: " + response.status);            const htmlData = await response.text();            document.getElementById('popup-content-area').innerHTML = htmlData; // 로드된 HTML 삽입        } catch (error) {            console.error("HTML 로딩오류:", error);        }    }    // PDF 변환버튼클릭이벤트    document.getElementById('pdf-convert-button').addEventListener('click', async function () {        const element = document.getElementById('popup-content-area');        // 변환할 HTML 파일경로        const url = 'your-html-file.html'; // 변환할 HTML 파일경로를지정하세요.        await loadHTMLContent(url); // HTML 파일로드        // PDF 변환옵션설정        const opt = {            margin: 1,            filename: '유저_레포트.pdf',            image: { type: 'jpeg', quality: 0.98 },            html2canvas: { scale: 2 },            jsPDF: { unit: 'in', format: 'letter', orientation: 'portrait' }        };        // PDF 생성및다운로드        html2pdf().from(element).set(opt).save();    });    // 저장버튼 (기능구현예정)    document.getElementById('save-button').addEventListener('click', function () {        alert('저장기능은추후구현예정입니다.');    });</script></body>
  • The PDF generation ends up failing or producing an empty result.
  • On localhost, everything works fine. Only on the dpre.kr domain, I get this warning/error.
  1. What I've tried:

    • Removed all HTTPS references from NGINX config.
    • removed Certbot and related things like /etc/letsencrypt,,,
    • Ran sudo ufw status to confirm only Nginx HTTP is allowed.
    • I also suspected HSTS issues, so I tried clearing the Chrome HSTS cache using chrome://net-internals/#hsts, but I'm still seeing the same warning.
  2. Questions:

    • Is there any leftover SSL or HTTPS configuration at Cafe24 side (like forcing HSTS or something) that I need to remove?
    • Could it be a browser or cache issue, even though I cleared HSTS and there's no more SSL on my NAS?
    • How can I completely reset my domain to be purely HTTP so that html2pdf doesn't complain about "should be served over HTTPS"?

Additional details:

  • NAS server is hosting Node.js behind NGINX, but SSL was never properly installed because the hosting doesn't support custom certificates.
  • Now I'm only using HTTP.
  • I'd prefer not to use HTTPS if the Node.js environment won't let me install certs.

Any suggestions on fully removing or resetting any lingering HTTPS/HSTS settings so that the domain is truly served only via HTTP? Thanks!


Viewing all articles
Browse latest Browse all 1585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>