Attempt #6 to fix CORS issue and docker build.
This commit is contained in:
@@ -20,19 +20,19 @@ http {
|
||||
}
|
||||
|
||||
# Proxy IO requests
|
||||
#location /socket.io/ {
|
||||
# proxy_pass http://0.0.0.0:8081;
|
||||
# proxy_http_version 1.1;
|
||||
# proxy_set_header Upgrade $http_upgrade;
|
||||
# proxy_set_header Connection 'upgrade';
|
||||
# proxy_set_header Host $host;
|
||||
# proxy_cache_bypass $http_upgrade;
|
||||
location /socket.io/ {
|
||||
proxy_pass http://0.0.0.0:8081;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
|
||||
# # CORS settings
|
||||
# add_header 'Access-Control-Allow-Origin' '*';
|
||||
# add_header 'Access-Control-Allow-Methods' '*';
|
||||
# add_header 'Access-Control-Allow-Headers' '*';
|
||||
#}
|
||||
# CORS settings
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' '*';
|
||||
add_header 'Access-Control-Allow-Headers' '*';
|
||||
}
|
||||
|
||||
# Error pages
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
|
||||
@@ -1,15 +1,7 @@
|
||||
import { defineConfig } from "vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import { defineConfig } from 'vite'
|
||||
import react from '@vitejs/plugin-react'
|
||||
|
||||
// https://vite.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react()],
|
||||
server: {
|
||||
proxy: {
|
||||
"/socket.io": {
|
||||
target: "http://localhost:8081",
|
||||
changeOrigin: true,
|
||||
ws: true, // Enables WebSocket proxying
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
})
|
||||
Reference in New Issue
Block a user