Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I run it on windows, how do I use the nginx reverse proxy and be accessible to the public network #764

Open
yanghang3032 opened this issue Feb 22, 2025 · 1 comment

Comments

@yanghang3032
Copy link

When I run it on windows, how do I use the nginx reverse proxy and be accessible to the public network?

@yangjieshao
Copy link

yangjieshao commented Feb 23, 2025

local network
frpc
Image


# your proxy name will be changed to {user}.{proxy}
user = "test"

serverAddr = "1x.2x.1x.1x"
serverPort = 7000
loginFailExit = true

log.level = "debug"
log.disablePrintColor = true


udpPacketSize = 1500

[[proxies]]
name = "Webrtc"
type = "tcp"
localIP = "127.0.0.1"
localPort = 8010
remotePort = 8010
# If true, traffic of this proxy will be encrypted, default is false
transport.useEncryption = true
# If true, traffic will be compressed
transport.useCompression = true


frpc.exe -c frpc.toml

webrtc-streamer
webrtc-streamer.exe -D- -o -s- -H 0.0.0.0:8010 -R 10000:11000 -Tusername:[email protected]:3478


public network

frps

docker run --restart=always -d --network host \
           --name frp_server \
           -v /usr/docker.conf/frp/frps.toml:/etc/frp/frps.toml \
           snowdreamtech/frps

frps.toml


# A literal address or host name for IPv6 must be enclosed
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
# For single "bindAddr" field, no need square brackets, like `bindAddr = "::"`.
bindAddr = "0.0.0.0"
bindPort = 7000


# Configure the web server to enable the dashboard for frps.
# dashboard is available only if webServer.port is set.
webServer.addr = "0.0.0.0"
webServer.port = 7500
webServer.user = "username"
webServer.password = "pwd"

nginx


    server {
        listen       8011 ssl;
        listen  [::]:8011 ssl;
        server_name  localhost;
		client_max_body_size 1024m;
        ssl_certificate      /etc/nginx/conf.d/xxx.crt;  # 这个是证书的crt文件所在目录
        ssl_certificate_key  /etc/nginx/conf.d/xxx.key;  # 这个是证书key文件所在目录

        ssl_session_cache    shared:SSL:1m;
        ssl_session_timeout  5m;

        ssl_ciphers  HIGH:!aNULL:!MD5;
        ssl_prefer_server_ciphers  on;

        location / {
            proxy_pass http://127.0.0.1:8010;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $http_host;
			add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
			add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';

			if ($request_method = 'OPTIONS') {
				return 204;
			}
            root   /usr/share/nginx/html;
            index  index.html index.htm;
        }
		
    }

turn server

docker run --restart=always -d --network=host \
           --name turn_server2 paullouisageneau/violet  \
           --credentials=username:pwd

now you can visit https://publicweb.com:8011 or http://publicweb.com:8010

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants