# DirectoryIndex disabled
# RewriteEngine On
# RewriteRule ^$ http://127.0.0.1:3000/ [P,L]
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ http://127.0.0.1:3000/$1 [P,L]


# DirectoryIndex disabled
# RewriteEngine On

# # Proxy WebSocket requests if the Upgrade header is present
# RewriteCond %{HTTP:Upgrade} =websocket [NC]
# RewriteRule ^(.*)$ ws://127.0.0.1:4001/$1 [P,L]

# # Proxy the root URL to your Node.js HTTP server
# RewriteRule ^$ http://127.0.0.1:3000/ [P,L]

# # Proxy all other requests to your Node.js HTTP server if the file/directory doesn’t exist
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ http://127.0.0.1:3000/$1 [P,L]

DirectoryIndex disabled
RewriteEngine On

# WebSocket proxying
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^(.*)$ "ws://127.0.0.1:4001/$1" [P,L]

# Regular HTTP proxying
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://127.0.0.1:4000/$1 [P,L]
