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

请问安装ngrok 里面80端口能换别的吗? 好和我的ngnix避免冲突 #8

Closed
hccgk opened this issue May 18, 2018 · 3 comments

Comments

@hccgk
Copy link

hccgk commented May 18, 2018

rt

@hccgk
Copy link
Author

hccgk commented May 18, 2018

install_ngrok 方法
/usr/local/ngrok/bin/ngrokd -domain=$NGROK_DOMAIN -httpAddr=":80"

@panyongwei
Copy link
Owner

你可以在nginx反响代理回来,你的ngrok采用别的端口,nginx方向代理ngrok的端口

@Alysay
Copy link

Alysay commented Jul 20, 2018

@hccgk

我服务器上面是这样做的你可以参考下 supervisor 监控ngrokd进程

[program:ngrokd]
directory=/usr/local/ngrok/bin
command=/usr/local/bin/ngrokd -tlsKey=server.key -tlsCrt=server.crt -domain="example.com" -httpAddr=":8888" -httpsAddr=":8443"
autostart=true
autorestart=true
user=root
.....

下面是nginx 配置的反向代理

server {
        listen 80;
        server_name *.example.com;
        keepalive_timeout 70;
        proxy_set_header "Host" $host:8888;
        location / {
                proxy_pass_header Server;
                proxy_redirect off;
                proxy_pass http://127.0.0.1:8888;
        }
        access_log off;
        log_not_found off;
}

@hccgk hccgk closed this as completed Aug 12, 2018
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

3 participants