40 lines
1.2 KiB
Nginx Configuration File
40 lines
1.2 KiB
Nginx Configuration File
# nginx.conf
|
|
# This file will be mounted into /etc/nginx/conf.d/default.conf inside the container
|
|
|
|
# Enable proxy buffers (optional but recommended)
|
|
proxy_buffering on;
|
|
proxy_buffers 16 16k;
|
|
proxy_buffer_size 32k;
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
# --------------------------------------------------------------------
|
|
# Proxy everything under "/" to the php server backend
|
|
# --------------------------------------------------------------------
|
|
location / {
|
|
proxy_pass http://192.168.37.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;
|
|
}
|
|
# ----- Custom Nginx Configuration (inside <location> block) -----
|
|
location /socket.io/ {
|
|
# Forward to the Node WS server
|
|
proxy_pass http://192.168.37.1:3000; # or <node_container_ip>
|
|
|
|
# Keep WebSocket upgrade headers
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
|
|
# Optional: pass on other headers you care about
|
|
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;
|
|
}
|
|
|
|
}
|
|
|