Fix Caddyfile TLS directive syntax and optimize configuration for WebSocket support
This commit is contained in:
22
Caddyfile
22
Caddyfile
@@ -1,17 +1,9 @@
|
|||||||
markov.elpatron.me {
|
markov.elpatron.me {
|
||||||
# Use Let's Encrypt for SSL certificates
|
# Use Let's Encrypt for SSL certificates
|
||||||
elpatron@mailbox.org
|
tls elpatron@mailbox.org
|
||||||
|
|
||||||
# Proxy all requests to the Flask application
|
# Proxy all requests to the Flask application
|
||||||
reverse_proxy markov-economics:5000 {
|
reverse_proxy markov-economics:5000
|
||||||
# WebSocket support
|
|
||||||
header_up Upgrade {header.Upgrade}
|
|
||||||
header_up Connection {header.Connection}
|
|
||||||
header_up Host {host}
|
|
||||||
header_up X-Real-IP {remote_host}
|
|
||||||
header_up X-Forwarded-For {remote_host}
|
|
||||||
header_up X-Forwarded-Proto {scheme}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Handle WebSocket upgrade requests specifically
|
# Handle WebSocket upgrade requests specifically
|
||||||
@websockets {
|
@websockets {
|
||||||
@@ -19,13 +11,5 @@ markov.elpatron.me {
|
|||||||
header Upgrade websocket
|
header Upgrade websocket
|
||||||
}
|
}
|
||||||
|
|
||||||
reverse_proxy @websockets markov-economics:5000 {
|
reverse_proxy @websockets markov-economics:5000
|
||||||
# Ensure WebSocket headers are properly forwarded
|
|
||||||
header_up Upgrade {header.Upgrade}
|
|
||||||
header_up Connection {header.Connection}
|
|
||||||
header_up Host {host}
|
|
||||||
header_up X-Real-IP {remote_host}
|
|
||||||
header_up X-Forwarded-For {remote_host}
|
|
||||||
header_up X-Forwarded-Proto {scheme}
|
|
||||||
}
|
|
||||||
}
|
}
|
Reference in New Issue
Block a user