vite-pwa / vite-plugin-pwa

Zero-config PWA for Vite
https://vite-pwa-org.netlify.app/
MIT License
3.24k stars 211 forks source link

Service Worker redirects to http in reverse proxy #511

Open cipherseven opened 1 year ago

cipherseven commented 1 year ago

My Nuxt 3 Implementation of this is a reverse proxy through an NGINX environment that goes from 443 https on the client to 80 on the docker container holding my nuxt 3 files/server.

sw.js changes my hostname from https://someplace.com to http://someplace.com and causes a mixed content error in the browser. Am I missing something? I've looked long and hard for a configuration solution to fix this. Please let me know if this is an oversight or an error on my part. Thanks.

cipherseven commented 1 year ago

It seems it isn't even reading the correct url (strips the .com)

This is the console warning:

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

NekoSukuriputo commented 2 months ago

@cipherseven I have the same issue as you, have you been able to fix this issue?

Pentadome commented 1 month ago

facing the same problem rn. Any workaround?

z384647062 commented 6 days ago

facing the same problem