try deploy
This commit is contained in:
parent
3cf46bdcbd
commit
3a1d77e538
@ -2,6 +2,7 @@ import { defineConfig } from 'vite'
|
|||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
base: '/go/', // 👈 Это ключевая строка
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
server: {
|
server: {
|
||||||
port: 3000
|
port: 3000
|
||||||
|
|||||||
3
main.go
3
main.go
@ -48,10 +48,13 @@ func main() {
|
|||||||
// Initialize random seed
|
// Initialize random seed
|
||||||
rand.Seed(time.Now().UnixNano())
|
rand.Seed(time.Now().UnixNano())
|
||||||
|
|
||||||
|
|
||||||
// Serve static files
|
// Serve static files
|
||||||
fs := http.FileServer(http.Dir("./frontend/dist"))
|
fs := http.FileServer(http.Dir("./frontend/dist"))
|
||||||
http.Handle("/", fs)
|
http.Handle("/", fs)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// WebSocket endpoint
|
// WebSocket endpoint
|
||||||
http.HandleFunc("/go/ws", handleWebSocket)
|
http.HandleFunc("/go/ws", handleWebSocket)
|
||||||
|
|
||||||
|
|||||||
@ -51,18 +51,20 @@ server {
|
|||||||
try_files $uri $uri/ =404;
|
try_files $uri $uri/ =404;
|
||||||
}
|
}
|
||||||
location /go/ {
|
location /go/ {
|
||||||
proxy_pass http://127.0.0.1:8080/;
|
proxy_pass http://127.0.0.1:8080/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
location /assets/ {
|
location /go/assets/ {
|
||||||
proxy_pass http://127.0.0.1:8080/assets/;
|
proxy_pass http://127.0.0.1:8080/assets/;
|
||||||
proxy_set_header Host $host;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
location /go/ws { # is important here no slash in the end
|
location /go/ws { # is important here no slash in the end
|
||||||
proxy_pass http://127.0.0.1:8080/go/ws; # and here no slash in the end
|
proxy_pass http://127.0.0.1:8080/go/ws; # and here no slash in the end
|
||||||
|
|||||||
@ -25,12 +25,14 @@ server {
|
|||||||
}
|
}
|
||||||
location /go/ {
|
location /go/ {
|
||||||
proxy_pass http://127.0.0.1:8080/;
|
proxy_pass http://127.0.0.1:8080/;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_set_header X-Forwarded-Proto $scheme;
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
}
|
}
|
||||||
location /assets/ {
|
location /go/assets/ {
|
||||||
proxy_pass http://127.0.0.1:8080/assets/;
|
proxy_pass http://127.0.0.1:8080/assets/;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user