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

怎么配置多端口,多应用的http代理? #287

Closed
jun4997 opened this Issue Mar 31, 2017 · 4 comments

Comments

Projects
None yet
6 participants
@jun4997
Copy link

jun4997 commented Mar 31, 2017

比如我有 a,b,c三个应用,我要映射到三个一个域名下的三个端口上该怎么配置

@LoveyCat

This comment has been minimized.

Copy link

LoveyCat commented Apr 5, 2017

我的配置是这样的
Server:
[common]
bind_port=7000
vhost_http_port=server.port
dashboard_port=7500
dashboard_user=admin
dashboard_pwd=admin

[web]
type=http
custom_domains=examp1.com
auth_token=123

[web1]
type=http
custom_domains=examp2.com
auth_token=123

Client:
[common]
server_addr=server.ip
server_port=7000
auth_token=123

[web]
type=http
local_port=client.port1

[web1]
type=http
local_port=client.port2

按理说应该访问examp1.com的时候应该访问到的是client的port1的web服务,访问examp2.com的时候应该访问到client的port2的web服务,但是实际上都是访问到了port1的web服务。
所以我也是同问。

@swshag

This comment has been minimized.

Copy link

swshag commented Apr 20, 2017

[common]
server_addr = 10.0.0.0
server_port = 00000
privilege_token = *******

[web01]
type = http
local_ip = 127.0.0.0
local_port = 5000
use_gzip = true
use_encryption = true
pool_count = 20
privilege_mode = true
custom_domains = www.****.com
locations = /

[web02]
privilege_mode = true
type = http
local_ip = 127.0.0.0
local_port = 5005
custom_domains = www.****.com
locations = /news,/about

我也同问!

@openmynet

This comment has been minimized.

Copy link

openmynet commented Apr 23, 2017

借助nginx实现啊
ngxin

server {
  listen 80;
  server_name app1.* app2.* app3.*;
  ## send request back to apache ##
  location / {
  client_max_body_size    1000m;  
 #frps端口8080
  proxy_pass http://127.0.0.1:8080;  
	proxy_redirect off;
	proxy_set_header X-Real-IP $remote_addr;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header Host $http_host;
	proxy_set_header X-NginX-Proxy true;
 }
}

frps配置

[common]
bind_addr = 0.0.0.0
bind_port = 7000
vhost_http_port = 8080
auth_token = openittoken
subdomain_host = testapp.com

[app1]
type = http
auth_token = openittoken
subdomain = app1
[app2]
type = http
auth_token = openittoken
subdomain = app2
[app3]
type = http
auth_token = openittoken
subdomain = app3

frpc 配置

[common]
server_addr = *.23.72.*
server_port = 7000
auth_token =openittoken

[app1]
type = http
local_port = 8081

[app2]
type = http
local_port = 8082

[app3]
type = http
local_port = 8083

app1.testapp.com => client:8081
app2.testapp.com => client:8082
app3.testapp.com => client:8083

@yfhust

This comment has been minimized.

Copy link

yfhust commented Oct 1, 2018

弱弱问一下,服务器上运行多个frps实例可以解决这个问题吗?小白不懂nginx配置

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment