Last active
July 21, 2023 21:30
-
-
Save aschuhardt/6a66e45103a4d1faef68ca44ca97eb55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stream { | |
### | |
### Setup | |
### | |
# connection-limiting | |
limit_conn_zone $binary_remote_addr zone=addr:10m; | |
limit_conn_log_level warn; | |
limit_conn addr 1; | |
# logging | |
log_format basic '$remote_addr $upstream_addr [$time_local] ' | |
'$protocol $status $bytes_sent $bytes_received ' | |
'$session_time'; | |
access_log syslog:server=unix:/dev/log basic; | |
error_log stderr; | |
# map SNI -> backend service | |
map $ssl_preread_server_name $name { | |
your.domain.name backend_1; | |
} | |
### | |
### Frontends | |
### | |
# Gemini | |
server { | |
listen 1965; | |
ssl_preread on; | |
proxy_buffer_size 16k; | |
# pass requests directly to the corresponding Gemini server | |
proxy_pass $name; | |
} | |
### | |
### Backends | |
### | |
# one of your capsules | |
upstream backend_1 { | |
server 127.0.0.1:1990; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment