webman
webman copied to clipboard
How to use subdomain in webman
I have category in news site for example
http://news.example.com
http://category.example.com
how to create news app and other category app ?
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

## 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'),

```
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;
}
}
}
```