Skip to content

Instantly share code, notes, and snippets.

@aschuhardt
Last active July 21, 2023 21:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aschuhardt/6a66e45103a4d1faef68ca44ca97eb55 to your computer and use it in GitHub Desktop.
Save aschuhardt/6a66e45103a4d1faef68ca44ca97eb55 to your computer and use it in GitHub Desktop.
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