try deploy

This commit is contained in:
nitros 2025-05-04 15:12:39 +07:00
parent 3cf46bdcbd
commit 3a1d77e538
4 changed files with 21 additions and 13 deletions

View File

@ -2,6 +2,7 @@ import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
base: '/go/', // 👈 Это ключевая строка
plugins: [vue()],
server: {
port: 3000

View File

@ -48,13 +48,16 @@ func main() {
// Initialize random seed
rand.Seed(time.Now().UnixNano())
// Serve static files
fs := http.FileServer(http.Dir("./frontend/dist"))
http.Handle("/", fs)
// WebSocket endpoint
http.HandleFunc("/go/ws", handleWebSocket)
log.Println("Server starting on :8080...")
log.Fatal(http.ListenAndServe(":8080", nil))
}
}

View File

@ -51,18 +51,20 @@ server {
try_files $uri $uri/ =404;
}
location /go/ {
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
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;
proxy_pass http://127.0.0.1:8080/;
proxy_set_header Host $host;
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 /assets/ {
proxy_pass http://127.0.0.1:8080/assets/;
proxy_set_header Host $host;
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/assets/ {
proxy_pass http://127.0.0.1:8080/assets/;
proxy_http_version 1.1;
proxy_set_header Host $host;
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
proxy_pass http://127.0.0.1:8080/go/ws; # and here no slash in the end

View File

@ -25,12 +25,14 @@ server {
}
location /go/ {
proxy_pass http://127.0.0.1:8080/;
proxy_http_version 1.1;
proxy_set_header Host $host;
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 /assets/ {
location /go/assets/ {
proxy_pass http://127.0.0.1:8080/assets/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;