sdmswitch/sdm/data/nls-cloud-sdm/conf/nginx-proxy.conf
2023-10-11 04:39:21 +00:00

94 lines
3.0 KiB
Plaintext
Executable File

user admin;
worker_processes 1;
worker_rlimit_nofile 100000;
error_log "pipe:/opt/taobao/install/cronolog/sbin/cronolog /home/admin/cai/logs/cronolog/%Y/%m/%Y-%m-%d-error_log" warn;
pid /home/admin/cai/tengine.pid;
events {
use epoll;
worker_connections 20480;
}
http {
include mime.types;
default_type application/octet-stream;
root htdocs;
sendfile on;
tcp_nopush on;
server_tokens off;
keepalive_timeout 0;
client_header_timeout 1m;
send_timeout 1m;
client_max_body_size 100m;
variables_hash_max_size 1024;
index index.html index.htm;
log_format proxyformat "$remote_addr $request_time_usec $http_x_readtime [$time_local] \"$request_method http://$host:$server_port:$request_uri\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" \"$md5_encode_cookie_unb\" \"$md5_encode_cookie_cookie2\"";
#access_log "pipe:/opt/taobao/install/cronolog/sbin/cronolog /home/admin/cai/logs/cronolog/%Y/%m/%Y-%m-%d-%H-taobao-access_log" proxyformat;
log_not_found off;
gzip on;
gzip_http_version 1.0;
gzip_comp_level 6;
gzip_min_length 1024;
gzip_proxied any;
gzip_vary on;
gzip_disable msie6;
gzip_buffers 96 8k;
gzip_types text/xml text/plain text/css application/javascript application/x-javascript application/rss+xml application/json;
proxy_redirect off;
proxy_buffers 128 8k;
proxy_intercept_errors on;
proxy_headers_hash_max_size 51200;
proxy_headers_hash_bucket_size 6400;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Web-Server-Type nginx;
proxy_set_header WL-Proxy-Client-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 5m;
#websocket
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 7008 default_server;
location /metrics {
proxy_pass http://127.0.0.1:7009/metrics;
}
location /sdm_metrics {
proxy_pass http://127.0.0.1:7009/metrics;
}
location ~ /maybeOtherPath/prefix {
rewrite '^/maybeOtherPath/prefix/(.*)$' /$1;
}
location ~ \.(fla|pcm|mp3|wav)$ {
#access_log assets.access.log;
default_type audio/x-wav;
expires 180d;
root /home/admin/nls-cloud-sdm/var/;
if ($arg_download){
add_header Content-Disposition "attachment; filename=$arg_download";
}
}
}
}