saleor / saleor-storefront

A GraphQL-powered, NextJs-based, PWA storefront for Saleor. IMPORTANT: This project is [DEPRECATED] in favor of saleor/react-storefront soon to become our default demo and storefront starter pack.

Home Page:https://demo.saleor.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Storefront uses http to request to api (api uri with https) to load images

ppldheeraj opened this issue · comments

What I'm trying to achieve


To fetch all the data of a product (object)

Steps to reproduce the problem

  1. host the saleor api on some different host with https (nginx)
  2. use that url in .env file of saleor-front as next_public_api_uri
  3. start the app, open a category , it doesn't show the images of products, in inspect it can be seen that request is being made to http instead of https while this is not the case with saleor-dashboard.
    Screenshot from 2021-09-01 11-50-41
    Screenshot from 2021-09-15 00-04-21

What I expected to happen

it should make https requests to media content also as it does for other get and post requests.

Screenshots

System information
Operating system:
Browser:

your nginx should set a https header,

set_header X_FORWARDED_PROTO https

and the django shoud set this in the setting.py

SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')