Skip to content

Running prisma studio behind a nginx https reverse proxy doesn't work #688

Description

@KptCheeseWhiz

Prisma studio always use http for its API, which trigger a mixed content error on modern browers.

Mixed Content: The page at 'https://xxx.xxx.com/' was loaded over HTTPS, but requested an insecure resource 'http://xxx.xxx.com/api'. This request has been blocked; the content must be served over HTTPS.

The offending line seems to be in databrowser.js:3 where window.location.protocol should be used instead of just http:

import "./assets/index.js";
import "./assets/vendor.js";
let t = window.__vite_plugin_react_preamble_installed__ ? "http://localhost:9999/api" : `http://${window.location.host}/api`;
window.databrowser({
    transport: {
        type: "http",
        url: t
    }
});

Adding a breakpoint there and changing manually the value fixes the problem.

Metadata

Metadata

Assignees

Labels

kind/improvementAn improvement to existing feature and code.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions