Files
Termix/docker/nginx.conf

43 lines
1.2 KiB
Nginx Configuration File

events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 8080;
server_name localhost;
# Serve the React app
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
# Proxy IO requests
location /socket.io/ {
proxy_pass http://localhost: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 headers
add_header 'Access-Control-Allow-Origin' '*'; # Allow all origins (can be restricted to a specific domain)
add_header 'Access-Control-Allow-Methods' 'GET, POST'; # Allow GET and POST methods
add_header 'Access-Control-Allow-Headers' 'Content-Type, Accept'; # Standard headers for requests
}
# Error pages
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
}