jnsgruk / wireguard-over-wss

Resources to tunnel Wireguard over Websockets
MIT License
174 stars 37 forks source link

Nginx reverse proxy #9

Closed koss822 closed 1 month ago

koss822 commented 6 months ago

Would be also nice to explain NGINX reverse proxy

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
    worker_connections  1024;
}

stream {
  resolver 8.8.8.8;

  map $ssl_preread_server_name $selected_upstream {
    YOUR.WIREGUARD.WEBSITE.COM 127.0.0.1:10443;
    default 127.0.0.1:8443; # YOUR EXISTING HTTPS WEBSERVER ADDRESS
  }

  server {
    listen 443; # PORT WE WILL LISTEN ON
    proxy_pass $selected_upstream;
    ssl_preread on;
  }
}

source: WebSocket connection to WireGuard

jnsgruk commented 4 months ago

Not sure I understand this issue -- it seems like an explanation of the generic case where one can reverse proxy onto a local service on the server machine, rather than specifically related to tunnelling wireguard over websockets?