# Install inside the nginx http {} context after replacing the domain and # certificate paths. The application itself listens only on 127.0.0.1:8102. limit_req_zone $binary_remote_addr zone=znkg_login:10m rate=10r/m; limit_req_zone $binary_remote_addr zone=znkg_openapi:10m rate=120r/m; server { listen 80; listen [::]:80; server_name data.example.cn; return 301 https://$host$request_uri; } server { listen 443 ssl; listen [::]:443 ssl; http2 on; server_name data.example.cn; ssl_certificate /etc/letsencrypt/live/data.example.cn/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/data.example.cn/privkey.pem; ssl_protocols TLSv1.2 TLSv1.3; ssl_session_timeout 1d; ssl_session_cache shared:ZNKG_SSL:10m; ssl_session_tickets off; client_max_body_size 55m; server_tokens off; location = /v1/admin/auth/login { limit_req zone=znkg_login burst=5 nodelay; proxy_pass http://127.0.0.1:8102; include proxy_params; proxy_set_header X-Forwarded-Proto https; } location /v1/openapi/ { limit_req zone=znkg_openapi burst=40 nodelay; proxy_pass http://127.0.0.1:8102; include proxy_params; proxy_set_header X-Forwarded-Proto https; } location / { proxy_pass http://127.0.0.1:8102; include proxy_params; proxy_set_header X-Forwarded-Proto https; proxy_read_timeout 120s; } }