- Express.js backend with JWT authentication - CRUD endpoints for apps management - Health check endpoint - Dockerfile per admin API (Node 18 Alpine) - Kubernetes: admin-api deployment, service, ingress - Admin panel at http://admin.apps.local - Updated nginx.conf to route /api to admin API - Fixed ingress rules for separate web and admin services
46 lines
1.1 KiB
Nginx Configuration File
46 lines
1.1 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name apps.local admin.apps.local;
|
|
|
|
root /usr/share/nginx/html;
|
|
index index.html admin.html;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.html;
|
|
}
|
|
|
|
location /admin {
|
|
alias /usr/share/nginx/html;
|
|
try_files $uri $uri/ /admin.html;
|
|
}
|
|
|
|
location /admin/ {
|
|
alias /usr/share/nginx/html;
|
|
try_files $uri $uri/ /admin.html;
|
|
}
|
|
|
|
location /apps.json {
|
|
add_header Content-Type application/json;
|
|
add_header Access-Control-Allow-Origin *;
|
|
}
|
|
|
|
location /api {
|
|
proxy_pass http://localhost:3000/api;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection 'upgrade';
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_min_length 1024;
|
|
gzip_types text/plain text/css text/xml text/javascript application/javascript application/xml application/json;
|
|
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|