Files
Cloud-Tour-to-Libo/deploy/nginx/travel-kg.conf.example
T

65 lines
2.0 KiB
Plaintext

# 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;
}
# Only graph file import accepts a large request. The API independently
# limits the file to GRAPH_IMPORT_MAX_BYTES (default 1 GiB); allow room for
# multipart headers/Schema. All other endpoints retain the 55m limit.
location = /v1/admin/projects/provision-file {
client_max_body_size 1030m;
proxy_pass http://127.0.0.1:8102;
include proxy_params;
proxy_set_header X-Forwarded-Proto https;
proxy_http_version 1.1;
proxy_request_buffering off;
proxy_buffering off;
proxy_read_timeout 120s;
proxy_send_timeout 120s;
}
location / {
proxy_pass http://127.0.0.1:8102;
include proxy_params;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 120s;
}
}