|
worker_processes auto; |
|
|
|
worker_rlimit_nofile 65535; |
|
|
|
events { |
|
worker_connections 65535; |
|
|
|
multi_accept on; |
|
|
|
use epoll; |
|
} |
|
|
|
http { |
|
|
|
|
|
keepalive_timeout 120; |
|
keepalive_requests 100; |
|
|
|
|
|
gzip on; |
|
gzip_vary on; |
|
gzip_proxied any; |
|
gzip_comp_level 6; |
|
gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml; |
|
|
|
|
|
include /etc/nginx/mime.types; |
|
|
|
|
|
server { |
|
listen 3001; |
|
|
|
location /ai/v1/ { |
|
rewrite ^/ai/v1/(.*)$ /v1/$1 break; |
|
proxy_pass http://127.0.0.1:3000; |
|
proxy_set_header Host $host; |
|
|
|
|
|
proxy_set_header X-Forwarded-For ""; |
|
proxy_set_header X-Real-IP ""; |
|
proxy_set_header X-Direct-Url ""; |
|
proxy_set_header X-Forwarded-Port ""; |
|
proxy_set_header X-Ip-Token ""; |
|
proxy_set_header X-Request-Id ""; |
|
proxy_set_header X-Amzn-Trace-Id ""; |
|
proxy_set_header X-Forwarded-Proto ""; |
|
} |
|
|
|
location / { |
|
proxy_pass http://127.0.0.1:3000; |
|
proxy_set_header Host $host; |
|
|
|
|
|
proxy_set_header X-Forwarded-For ""; |
|
proxy_set_header X-Real-IP ""; |
|
proxy_set_header X-Direct-Url ""; |
|
proxy_set_header X-Forwarded-Port ""; |
|
proxy_set_header X-Ip-Token ""; |
|
proxy_set_header X-Request-Id ""; |
|
proxy_set_header X-Amzn-Trace-Id ""; |
|
proxy_set_header X-Forwarded-Proto ""; |
|
} |
|
|
|
|
|
location = /429.html { |
|
return 429 'Too Many Requests'; |
|
} |
|
} |
|
|
|
|
|
error_log /dev/null crit; |
|
} |