Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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 info;
- error_log /var/log/nginx/error.log warn;
- # map SNI -> backend service, passes requests from frontend port 1958 to one of backend servers based on the domain used
- map $ssl_preread_server_name $name {
- hashnix.club cipres_server;
- server2.hashnix.club misfin_server;
- }
- ###
- ### Frontends
- ###
- # Misfin - the public-facing port to use for both servers (via different domains)
- server {
- listen 1958;
- ssl_preread on;
- proxy_buffer_size 16k;
- # pass requests directly to the corresponding Misfin server
- proxy_pass $name;
- }
- ###
- ### Backends
- ###
- # Misfin servers - backend-facing ports that the reverse proxy will proxy requests to, ensure misfin servers are bound to the bind addresses and ports below
- upstream cipres_server {
- server 127.0.0.1:1958; # Localhost Bind Address and port of misfin server
- }
- upstream misfin_server {
- server 127.0.0.1:1959; # Localhost Bind Address and port of misfin server, on different port from cipres_server
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement