Add frontend route

This commit is contained in:
oom 2025-01-20 18:17:06 +07:00
parent 1d8aa6ef04
commit 87cf07dd93

View file

@ -1271,6 +1271,102 @@ services:
- เป็นการตั้งค่าเฉพาะโปรแกรม จะแตกต่างกันไปตามโปรแกรม
- ตั้งค่า route สำหรับโดเมนต่างๆ (สำหรับ Frontend) และ Microservice (เป็นการรวมหลาย backend เข้าในโดเมนเดียวกันแต่อยู่คนละ Subfolder)
### BMA-HRMS frontend
โดเมนสำหรับหน้าโปรแกรมจะมีดังนี้
bmahrms.bangkok.go.th,bmahrms-user.bangkok.go.th,bmahrms-admin.bangkok.go.th,bmahrms-checkin.bangkok.go.th,bmahrms-recruiting.bangkok.go.th,bmahrms-exam.bangkok.go.th
จะต้องสร้าง route ให้ตรงกับหน้าที่ใช้งาน
```sh
curl "http://127.0.0.1:9180/apisix/admin/routes" \
-H "X-API-KEY: put_admin_api_key_here" -X PUT -d '
{
"id": "bmahrms",
"methods": ["GET"],
"host": "bmahrms.bangkok.go.th",
"uri": "/*",
"upstream": {
"type": "roundrobin",
"nodes": {
"bmahrms:80": 1
}
}
}'
curl "http://127.0.0.1:9180/apisix/admin/routes" \
-H "X-API-KEY: put_admin_api_key_here" -X PUT -d '
{
"id": "bmahrms-user",
"methods": ["GET"],
"host": "bmahrms-user.bangkok.go.th",
"uri": "/*",
"upstream": {
"type": "roundrobin",
"nodes": {
"bmahrms-user:80": 1
}
}
}'
curl "http://127.0.0.1:9180/apisix/admin/routes" \
-H "X-API-KEY: put_admin_api_key_here" -X PUT -d '
{
"id": "bmahrms-admin",
"methods": ["GET"],
"host": "bmahrms-admin.bangkok.go.th",
"uri": "/*",
"upstream": {
"type": "roundrobin",
"nodes": {
"bmahrms-admin:80": 1
}
}
}'
curl "http://127.0.0.1:9180/apisix/admin/routes" \
-H "X-API-KEY: put_admin_api_key_here" -X PUT -d '
{
"id": "bmahrms-checkin",
"methods": ["GET"],
"host": "bmahrms-checkin.bangkok.go.th",
"uri": "/*",
"upstream": {
"type": "roundrobin",
"nodes": {
"bmahrms-checkin:80": 1
}
}
}'
curl "http://127.0.0.1:9180/apisix/admin/routes" \
-H "X-API-KEY: put_admin_api_key_here" -X PUT -d '
{
"id": "bmahrms-recruiting",
"methods": ["GET"],
"host": "bmahrms-recruiting.bangkok.go.th",
"uri": "/*",
"upstream": {
"type": "roundrobin",
"nodes": {
"bmahrms-recruiting:80": 1
}
}
}'
curl "http://127.0.0.1:9180/apisix/admin/routes" \
-H "X-API-KEY: put_admin_api_key_here" -X PUT -d '
{
"id": "bmahrms-exam",
"methods": ["GET"],
"host": "bmahrms-exam.bangkok.go.th",
"uri": "/*",
"upstream": {
"type": "roundrobin",
"nodes": {
"bmahrms-exam:80": 1
}
}
}'
```
### BMA-HRMS backend
### Keycloak (bmahrms-id)
ใช้สำหรับการ login ในระบบ (Identity Server) เพื่อความปลอดภัยการสื่อสารเฉพาะภายใน จะเป็น https จะสร้าง self-signed certificate ขึ้นมาตัวอย่างนี้มีอายุ 10 ปี
@ -1380,6 +1476,7 @@ curl "http://127.0.0.1:9180/apisix/admin/routes" \
"id": "bmahrms-s3-console",
"host": "bma-hrms-s3.bangkok.go.th",
"uri": "/console/*",
"enable_websocket": true,
"plugins": {
"proxy-rewrite": {
"regex_uri": ["^/console/(.*)","/$1"]