Skip to main content
Glama
nginx.conf•6.99 kB
# Main nginx configuration for Tiger MCP user nginx; worker_processes auto; error_log /var/log/nginx/error.log notice; pid /var/run/nginx.pid; # Performance optimizations worker_rlimit_nofile 65535; events { worker_connections 4096; use epoll; multi_accept on; } http { # Basic settings include /etc/nginx/mime.types; default_type application/octet-stream; # Logging log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" ' 'rt=$request_time uct="$upstream_connect_time" ' 'uht="$upstream_header_time" urt="$upstream_response_time"'; access_log /var/log/nginx/access.log main; # Performance settings sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; client_max_body_size 100M; # Gzip compression gzip on; gzip_vary on; gzip_min_length 1024; gzip_comp_level 6; gzip_types text/plain text/css text/xml text/javascript application/json application/javascript application/xml+rss application/atom+xml image/svg+xml; # Security headers add_header X-Frame-Options "SAMEORIGIN" always; add_header X-Content-Type-Options "nosniff" always; add_header X-XSS-Protection "1; mode=block" always; add_header Referrer-Policy "strict-origin-when-cross-origin" always; add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval'; style-src 'self' 'unsafe-inline'; img-src 'self' data: https:; font-src 'self'; connect-src 'self'; frame-ancestors 'none';" always; # Rate limiting limit_req_zone $binary_remote_addr zone=api:10m rate=10r/s; limit_req_zone $binary_remote_addr zone=auth:10m rate=5r/s; # Upstream definitions upstream dashboard_api { server dashboard-api:8001 max_fails=3 fail_timeout=30s; keepalive 32; } upstream mcp_server { server mcp-server:8000 max_fails=3 fail_timeout=30s; keepalive 32; } # Health check endpoint server { listen 80; listen [::]:80; server_name localhost; location /nginx-health { access_log off; return 200 "healthy\n"; add_header Content-Type text/plain; } # Redirect all other HTTP traffic to HTTPS location / { return 301 https://$host$request_uri; } } # Main server block server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name localhost; # SSL configuration ssl_certificate /etc/ssl/certs/server.crt; ssl_certificate_key /etc/ssl/certs/server.key; ssl_session_timeout 1d; ssl_session_cache shared:SSL:50m; ssl_session_tickets off; # Modern SSL configuration ssl_protocols TLSv1.2 TLSv1.3; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers off; # Security headers for HTTPS add_header Strict-Transport-Security "max-age=63072000; includeSubDomains; preload" always; # Dashboard API routes location /api/ { limit_req zone=api burst=20 nodelay; proxy_pass http://dashboard_api/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; # Timeouts proxy_connect_timeout 5s; proxy_send_timeout 60s; proxy_read_timeout 60s; # Keep-alive proxy_http_version 1.1; proxy_set_header Connection ""; } # Authentication endpoints with stricter rate limiting location /api/auth/ { limit_req zone=auth burst=10 nodelay; proxy_pass http://dashboard_api/auth/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; # Timeouts proxy_connect_timeout 5s; proxy_send_timeout 30s; proxy_read_timeout 30s; # Keep-alive proxy_http_version 1.1; proxy_set_header Connection ""; } # MCP Server routes location /mcp/ { limit_req zone=api burst=20 nodelay; proxy_pass http://mcp_server/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; # WebSocket support for MCP proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Connection ""; # Timeouts proxy_connect_timeout 5s; proxy_send_timeout 300s; proxy_read_timeout 300s; } # Health check endpoint location /health { access_log off; return 200 "healthy\n"; add_header Content-Type text/plain; } # Combined health check for load balancers location /health/combined { access_log off; # Check all upstream services proxy_pass http://dashboard_api/health; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503; proxy_set_header Host $host; # If API is down, try MCP server error_page 500 502 503 504 = @mcp_health; } location @mcp_health { proxy_pass http://mcp_server/health; proxy_set_header Host $host; } # Default location location / { return 404 "Not Found"; } } # Include additional configurations include /etc/nginx/conf.d/*.conf; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/luxiaolei/tiger-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server