Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serving over HTTPS #7

Closed
akeslo opened this issue Jan 6, 2022 · 1 comment
Closed

Serving over HTTPS #7

akeslo opened this issue Jan 6, 2022 · 1 comment

Comments

@akeslo
Copy link

akeslo commented Jan 6, 2022

How are you serving this over HTTPS?

When doing so with nginx as a reverse proxy, app is crashing with following error:

client.ts:28 WebSocket connection to 'wss://siteurl:3000/' failed:
(anonymous) @ client:188
client.ts:222 [vite] server connection lost. polling for restart...

@akeslo
Copy link
Author

akeslo commented Jan 6, 2022

Got this working by updating vite.config.js to:

import { defineConfig } from "vite";
import { svelte } from "@sveltejs/vite-plugin-svelte";

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [svelte()],
  define: {
    "process.env": process.env,
  },
  server: {
    hmr: {
        // Internal port (in container same as sveltekit port).
        port: 443,
        // External port (Docker host)
        clientPort: 443
    }
  }
});

@akeslo akeslo closed this as completed Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant