-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
-
I have a dev code-server with prefix a/b, nginx like that:
location /a/b/ {
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
proxy_redirect http://$host https://$host/a/b;
proxy_buffering off;
proxy_pass http://<ip>:8080/;
}
Now I enable port forwading on that code server to forward dev server 5173, finally I get a url like that:
https://HOST/a/b/proxy/5173/
Now it asking for
https://HOST/@vite/client.
Obviously it don't exist. How can I make that correctly point to https://HOST/a/b/proxy/5173/@vite/client?
I have multiple dev server on that HOST so I don't want configure it directly on nginx.
Current vite.config.ts:
import { defineConfig } from 'vite'
import preact from '@preact/preset-vite'
export default defineConfig({
plugins: [preact()],
server: {
host: "0.0.0.0",
allowedHosts: ["HOST"]
},
base: "./"
})
I tried several settings for base and it seems the vite cannot correctly realize the nginx prefix a/b.
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment
-
change base to /a/b in vite config
Beta Was this translation helpful? Give feedback.
All reactions
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment