-
Notifications
You must be signed in to change notification settings - Fork 6.3k
-
Hi everyone! Help really wanted :( I have a self-hosted code-server instance and I want to run remix app inside of it. When app starts, code-server also starts port forwarding for particular port, so that application can be available outside of the container.
Example:
code-server deployed location: https://codeserver.somedomain.com/
proxied location (remix app): https://codeserver.somedomain.com/proxy/5173
But when i get into the app through the proxy (https://codeserver.somedomain.com/proxy/5173) the app can't actually resolve correctly resources. We can clearly see on network tab in devtools that all of them missing that proxy part, basically requesting resources from root of domain. For example root.tsx file will be requested from https://codeserver.somedomain.com/app/root.tsx, not https://codeserver.somedomain.com/proxy/5173/app/root.tsx. I was thinking about changing basename, but after playing around with base and basename in remix and vite configurations I wasn't able to successfully load resources...
Also I made a new discussion in remix repo, but I don't think there will be any guys who can help with that:
remix-run/remix#10050
If anyone have any suggestion or have experience with resolving that, your response will be highly appreciated!
Beta Was this translation helpful? Give feedback.
All reactions
The question was answered here #6212. The solution is proper absproxy usage. I missunderstood what does mean and what is expected usage of absproxy. Anyway, thats the solution I made:
vite.config.ts
import { vitePlugin as remix } from "@remix-run/dev"; import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; export default defineConfig({ base: '/absproxy/5173/', plugins: [ remix({ basename: '/absproxy/5173/', future: { v3_fetcherPersist: true, v3_relativeSplatPath: true, v3_throwAbortReason: true, }, }), tsconfigPaths(), ], });
Replies: 1 comment 1 reply
-
The question was answered here #6212. The solution is proper absproxy usage. I missunderstood what does mean and what is expected usage of absproxy. Anyway, thats the solution I made:
vite.config.ts
import { vitePlugin as remix } from "@remix-run/dev"; import { defineConfig } from "vite"; import tsconfigPaths from "vite-tsconfig-paths"; export default defineConfig({ base: '/absproxy/5173/', plugins: [ remix({ basename: '/absproxy/5173/', future: { v3_fetcherPersist: true, v3_relativeSplatPath: true, v3_throwAbortReason: true, }, }), tsconfigPaths(), ], });
Beta Was this translation helpful? Give feedback.
All reactions
-
Sorry for the delayed response, but glad you got it sorted! If you think of any way we can clear up absproxy in the documentation, do let me know, it is definitely confusing I think.
Beta Was this translation helpful? Give feedback.