2022-08-23 17:59:59 +00:00
|
|
|
# first we declare our upstream server, which is our http-server application
|
|
|
|
upstream robosats_http_server {
|
|
|
|
server localhost:9000;
|
2022-10-25 18:04:12 +00:00
|
|
|
|
2022-08-23 17:59:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
upstream robosats_websocket {
|
|
|
|
server localhost:81;
|
|
|
|
}
|
|
|
|
|
|
|
|
# now we declare our main server
|
|
|
|
server {
|
|
|
|
|
|
|
|
listen 12596;
|
|
|
|
server_name robosats_client;
|
|
|
|
|
|
|
|
location / {
|
|
|
|
# requests are passed to npm Http-Server
|
|
|
|
proxy_pass http://robosats_http_server;
|
|
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
proxy_redirect off;
|
|
|
|
}
|
|
|
|
|
2022-10-25 18:04:12 +00:00
|
|
|
|
2023-03-10 17:02:47 +00:00
|
|
|
# websockets are passed to socat bridge
|
2022-08-23 17:59:59 +00:00
|
|
|
location /ws/ {
|
|
|
|
proxy_pass http://robosats_websocket;
|
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection "Upgrade";
|
|
|
|
proxy_set_header Host $host;
|
|
|
|
}
|
|
|
|
|
|
|
|
location = /favicon.ico {
|
|
|
|
alias /usr/src/robosats/static/assets/images/favicon-96x96.png;
|
|
|
|
}
|
2023-03-10 17:02:47 +00:00
|
|
|
|
|
|
|
# do not log healtchecks made against "/selfhosted"
|
|
|
|
location /selfhosted {
|
|
|
|
access_log off;
|
|
|
|
return 200 "OK";
|
|
|
|
}
|
|
|
|
}
|