Skip to content

Commit 0a391e6

Browse files
authored
Merge pull request #8 from bamboooo-dev/feat/modify-nchan-config
pubsub の location 変更
2 parents 8f88661 + dd24122 commit 0a391e6

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

nginx/default.conf

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@ server {
1818

1919
nchan_channel_group_accounting on;
2020

21-
# /sub?channel_id=hogehoge?player_num=4 の形式で使う
22-
location = /sub {
21+
# /sub/hogehoge?player_num=4 の形式で使う
22+
location = /sub/(\w+) {
2323
nchan_subscriber;
24-
nchan_channel_group $arg_channel_id;
25-
nchan_channel_id $arg_channel_id;
24+
nchan_channel_group $1;
25+
nchan_channel_id $1;
2626
nchan_group_max_subscribers $arg_player_num;
2727
nchan_redis_pass my_redis_server;
2828
}
2929

30-
# /sub?channel_id=hogehoge の形式で使う
31-
location = /pub {
30+
# /pub/hogehoge の形式で使う
31+
location = /pub/(\w+)$ {
3232
nchan_publisher;
33-
nchan_channel_group $arg_channel_id;
34-
nchan_channel_id $arg_channel_id;
33+
nchan_channel_group $1;
34+
nchan_channel_id $1;
3535
nchan_redis_pass my_redis_server;
3636
}
3737

38-
# /group?channel_id=hogehoge の形式で使う
39-
location = /group {
40-
nchan_channel_group $arg_channel_id;
38+
# /group/hogehoge の形式で使う
39+
location = /group/(\w+)$ {
40+
nchan_channel_group $1;
4141
nchan_group_location;
4242
nchan_group_max_channels 1;
4343
nchan_redis_pass my_redis_server;

0 commit comments

Comments
 (0)