Open haidarvm opened 3 years ago
you can use nginx proxy
you can use nginx proxy
I know, i'm using nginx proxy but how to detected it as subdomain ?
中间件不能用吗?
中间件不能用吗?
can you give me example ?
@walkor can you solve this?
Without running multiple webman ?
Just from nginx conf ?
@haidarvm https://my.oschina.net/owenzhang24/blog/5585429 you can look my example
@haidarvm
![](https://oscimg.oschina.net/oscnet/up-a60e71de19404bf4b3e05882146b47fedad.png)
## www.owenzhang.com
index
127.0.0.1:8024
D:\owenzhang\workerman-owen\config\server.php
'listen' => env('SERVER_LISTEN', 'http://127.0.0.1:8024'),
![](https://oscimg.oschina.net/oscnet/up-94d16596bf16373349479324d914428fcd7.png)
upstream webman { server 127.0.0.1:8024; }
server { listen 80; listen 443 ssl; server_name www.owenzhang.com; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/workerman-owen/public;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
if (!-f $request_filename){
rewrite ^/(.*)$ /index/$1 break;
proxy_pass http://webman;
}
}
}
## www.ygkj.com
ygkj
server { listen 80; listen 443 ssl; server_name www.ygkj.com ygkj.com; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/workerman-owen/public;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
if (!-f $request_filename){
rewrite ^/(.*)$ /ygkj/$1 break;
proxy_pass http://webman;
}
}
}
## admin.owen.com
admin
server { listen 80; listen 443 ssl; server_name admin.owen.com; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/workerman-owen/public;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
if (!-f $request_filename){
rewrite ^/(.*)$ /admin/$1 break;
proxy_pass http://webman;
}
}
}
## www.xmkzjhb.com
xmkzjhb
server { listen 80; listen 443 ssl; server_name www.xmkzjhb.com; index index.php index.html index.htm default.php default.htm default.html; root /www/wwwroot/workerman-owen/public;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
if (!-f $request_filename){
rewrite ^/(.*)$ /xmkzjhb/$1 break;
proxy_pass http://webman;
}
}
}
I have category in news site for example
how to create news app and other category app ?