- Integrated additional Zod validation schemas for improved input validation across various API routes. - Updated existing services to utilize the new validation middleware, ensuring better request integrity. - Improved error handling mechanisms in key services to provide clearer feedback on request failures. - Conducted code cleanup to enhance readability and maintainability of the API services.
721 lines
24 KiB
Nginx Configuration File
721 lines
24 KiB
Nginx Configuration File
# Nginx configuration for eMoney Token Factory API
|
|
# Matches DNS configuration for d-bis.org domain
|
|
#
|
|
# This configuration handles:
|
|
# - Production API services (api.d-bis.org, mappings.api.d-bis.org, etc.)
|
|
# - Staging API services (api-staging.d-bis.org, etc.)
|
|
# - SSL/TLS termination
|
|
# - Load balancing
|
|
# - Rate limiting
|
|
# - Security headers
|
|
# - Health checks
|
|
|
|
# User and worker processes
|
|
user nginx;
|
|
worker_processes auto;
|
|
error_log /var/log/nginx/error.log warn;
|
|
pid /var/run/nginx.pid;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
use epoll;
|
|
multi_accept on;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
# Logging format
|
|
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;
|
|
|
|
# Basic settings
|
|
sendfile on;
|
|
tcp_nopush on;
|
|
tcp_nodelay on;
|
|
keepalive_timeout 65;
|
|
types_hash_max_size 2048;
|
|
server_tokens off;
|
|
client_max_body_size 10M;
|
|
|
|
# Gzip compression
|
|
gzip on;
|
|
gzip_vary on;
|
|
gzip_proxied any;
|
|
gzip_comp_level 6;
|
|
gzip_types text/plain text/css text/xml text/javascript
|
|
application/json application/javascript application/xml+rss
|
|
application/rss+xml font/truetype font/opentype
|
|
application/vnd.ms-fontobject image/svg+xml;
|
|
|
|
# Rate limiting zones
|
|
limit_req_zone $binary_remote_addr zone=api_limit:10m rate=100r/m;
|
|
limit_req_zone $binary_remote_addr zone=api_burst:10m rate=10r/s;
|
|
limit_req_zone $binary_remote_addr zone=webhook_limit:10m rate=50r/m;
|
|
|
|
# Connection limiting
|
|
limit_conn_zone $binary_remote_addr zone=conn_limit:10m;
|
|
limit_conn conn_limit 20;
|
|
|
|
# Upstream servers - Production REST API
|
|
upstream rest_api_production {
|
|
least_conn;
|
|
server 192.0.2.1:3000 max_fails=3 fail_timeout=30s;
|
|
# Add more servers for high availability
|
|
# server 192.0.2.101:3000 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# Upstream servers - Production Mapping Service
|
|
upstream mapping_service_production {
|
|
least_conn;
|
|
server 192.0.2.2:3004 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# Upstream servers - Production Webhook Service
|
|
upstream webhook_service_production {
|
|
least_conn;
|
|
server 192.0.2.3:3001 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# Upstream servers - Production Orchestrator Service
|
|
upstream orchestrator_service_production {
|
|
least_conn;
|
|
server 192.0.2.4:3002 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# Upstream servers - Production Packet Service
|
|
upstream packet_service_production {
|
|
least_conn;
|
|
server 192.0.2.5:3003 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# Upstream servers - Staging REST API
|
|
upstream rest_api_staging {
|
|
least_conn;
|
|
server 192.0.2.10:3000 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# Upstream servers - Staging Mapping Service
|
|
upstream mapping_service_staging {
|
|
least_conn;
|
|
server 192.0.2.11:3004 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# Upstream servers - Staging Webhook Service
|
|
upstream webhook_service_staging {
|
|
least_conn;
|
|
server 192.0.2.12:3001 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# Upstream servers - Staging Orchestrator Service
|
|
upstream orchestrator_service_staging {
|
|
least_conn;
|
|
server 192.0.2.13:3002 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# Upstream servers - Staging Packet Service
|
|
upstream packet_service_staging {
|
|
least_conn;
|
|
server 192.0.2.14:3003 max_fails=3 fail_timeout=30s;
|
|
keepalive 32;
|
|
}
|
|
|
|
# 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:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
|
|
ssl_prefer_server_ciphers off;
|
|
ssl_session_cache shared:SSL:10m;
|
|
ssl_session_timeout 10m;
|
|
ssl_session_tickets off;
|
|
ssl_stapling on;
|
|
ssl_stapling_verify on;
|
|
|
|
# Security headers
|
|
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
|
|
add_header X-Frame-Options "DENY" 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';" always;
|
|
|
|
# ============================================================================
|
|
# PRODUCTION SERVERS
|
|
# ============================================================================
|
|
|
|
# Production REST API - api.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name api.d-bis.org;
|
|
|
|
# Redirect HTTP to HTTPS
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name api.d-bis.org;
|
|
|
|
# SSL certificates (update paths)
|
|
ssl_certificate /etc/ssl/certs/api.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/api.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/api.d-bis.org-chain.crt;
|
|
|
|
# Rate limiting
|
|
limit_req zone=api_limit burst=20 nodelay;
|
|
limit_req_status 429;
|
|
|
|
# Health check endpoint (no rate limiting)
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://rest_api_production;
|
|
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;
|
|
}
|
|
|
|
# API endpoints
|
|
location /v1/ {
|
|
proxy_pass http://rest_api_production;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
# Timeouts
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
|
|
# Buffering
|
|
proxy_buffering on;
|
|
proxy_buffer_size 4k;
|
|
proxy_buffers 8 4k;
|
|
proxy_busy_buffers_size 8k;
|
|
}
|
|
|
|
# Deny access to hidden files
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# Production Mapping Service - mappings.api.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name mappings.api.d-bis.org;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name mappings.api.d-bis.org;
|
|
|
|
ssl_certificate /etc/ssl/certs/mappings.api.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/mappings.api.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/mappings.api.d-bis.org-chain.crt;
|
|
|
|
limit_req zone=api_limit burst=20 nodelay;
|
|
limit_req_status 429;
|
|
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://mapping_service_production;
|
|
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;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://mapping_service_production;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# Production Webhook Service - webhooks.api.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name webhooks.api.d-bis.org;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name webhooks.api.d-bis.org;
|
|
|
|
ssl_certificate /etc/ssl/certs/webhooks.api.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/webhooks.api.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/webhooks.api.d-bis.org-chain.crt;
|
|
|
|
limit_req zone=webhook_limit burst=10 nodelay;
|
|
limit_req_status 429;
|
|
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://webhook_service_production;
|
|
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;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://webhook_service_production;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# Production Orchestrator Service - orchestrator.api.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name orchestrator.api.d-bis.org;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name orchestrator.api.d-bis.org;
|
|
|
|
ssl_certificate /etc/ssl/certs/orchestrator.api.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/orchestrator.api.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/orchestrator.api.d-bis.org-chain.crt;
|
|
|
|
limit_req zone=api_limit burst=20 nodelay;
|
|
limit_req_status 429;
|
|
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://orchestrator_service_production;
|
|
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;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://orchestrator_service_production;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# Production Packet Service - packets.api.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name packets.api.d-bis.org;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name packets.api.d-bis.org;
|
|
|
|
ssl_certificate /etc/ssl/certs/packets.api.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/packets.api.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/packets.api.d-bis.org-chain.crt;
|
|
|
|
limit_req zone=api_limit burst=20 nodelay;
|
|
limit_req_status 429;
|
|
|
|
# Increase body size for packet downloads
|
|
client_max_body_size 50M;
|
|
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://packet_service_production;
|
|
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;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://packet_service_production;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 120s; # Longer timeout for packet generation
|
|
proxy_read_timeout 120s;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# ============================================================================
|
|
# STAGING SERVERS
|
|
# ============================================================================
|
|
|
|
# Staging REST API - api-staging.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name api-staging.d-bis.org;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name api-staging.d-bis.org;
|
|
|
|
ssl_certificate /etc/ssl/certs/api-staging.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/api-staging.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/api-staging.d-bis.org-chain.crt;
|
|
|
|
limit_req zone=api_limit burst=10 nodelay;
|
|
limit_req_status 429;
|
|
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://rest_api_staging;
|
|
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;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://rest_api_staging;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# Staging Mapping Service - mappings.api-staging.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name mappings.api-staging.d-bis.org;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name mappings.api-staging.d-bis.org;
|
|
|
|
ssl_certificate /etc/ssl/certs/mappings.api-staging.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/mappings.api-staging.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/mappings.api-staging.d-bis.org-chain.crt;
|
|
|
|
limit_req zone=api_limit burst=10 nodelay;
|
|
limit_req_status 429;
|
|
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://mapping_service_staging;
|
|
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;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://mapping_service_staging;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# Staging Webhook Service - webhooks.api-staging.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name webhooks.api-staging.d-bis.org;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name webhooks.api-staging.d-bis.org;
|
|
|
|
ssl_certificate /etc/ssl/certs/webhooks.api-staging.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/webhooks.api-staging.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/webhooks.api-staging.d-bis.org-chain.crt;
|
|
|
|
limit_req zone=webhook_limit burst=5 nodelay;
|
|
limit_req_status 429;
|
|
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://webhook_service_staging;
|
|
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;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://webhook_service_staging;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# Staging Orchestrator Service - orchestrator.api-staging.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name orchestrator.api-staging.d-bis.org;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name orchestrator.api-staging.d-bis.org;
|
|
|
|
ssl_certificate /etc/ssl/certs/orchestrator.api-staging.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/orchestrator.api-staging.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/orchestrator.api-staging.d-bis.org-chain.crt;
|
|
|
|
limit_req zone=api_limit burst=10 nodelay;
|
|
limit_req_status 429;
|
|
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://orchestrator_service_staging;
|
|
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;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://orchestrator_service_staging;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 60s;
|
|
proxy_read_timeout 60s;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# Staging Packet Service - packets.api-staging.d-bis.org
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name packets.api-staging.d-bis.org;
|
|
return 301 https://$server_name$request_uri;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl http2;
|
|
listen [::]:443 ssl http2;
|
|
server_name packets.api-staging.d-bis.org;
|
|
|
|
ssl_certificate /etc/ssl/certs/packets.api-staging.d-bis.org.crt;
|
|
ssl_certificate_key /etc/ssl/private/packets.api-staging.d-bis.org.key;
|
|
ssl_trusted_certificate /etc/ssl/certs/packets.api-staging.d-bis.org-chain.crt;
|
|
|
|
limit_req zone=api_limit burst=10 nodelay;
|
|
limit_req_status 429;
|
|
|
|
client_max_body_size 50M;
|
|
|
|
location = /health {
|
|
access_log off;
|
|
proxy_pass http://packet_service_staging;
|
|
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;
|
|
}
|
|
|
|
location /v1/ {
|
|
proxy_pass http://packet_service_staging;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
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-Request-ID $request_id;
|
|
|
|
proxy_connect_timeout 30s;
|
|
proxy_send_timeout 120s;
|
|
proxy_read_timeout 120s;
|
|
}
|
|
|
|
location ~ /\. {
|
|
deny all;
|
|
access_log off;
|
|
log_not_found off;
|
|
}
|
|
}
|
|
|
|
# Default server - catch all undefined domains
|
|
server {
|
|
listen 80 default_server;
|
|
listen [::]:80 default_server;
|
|
server_name _;
|
|
return 444;
|
|
}
|
|
|
|
server {
|
|
listen 443 ssl default_server;
|
|
listen [::]:443 ssl default_server;
|
|
server_name _;
|
|
ssl_certificate /etc/ssl/certs/default.crt;
|
|
ssl_certificate_key /etc/ssl/private/default.key;
|
|
return 444;
|
|
}
|
|
}
|
|
|