58 lines
1.5 KiB
Nginx Configuration File
58 lines
1.5 KiB
Nginx Configuration File
worker_processes auto;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include mime.types;
|
|
default_type application/octet-stream;
|
|
lua_package_path "/usr/local/openresty/lualib/?.lua;;";
|
|
|
|
# 通用头:全局禁止缓存
|
|
# ================================
|
|
add_header Cache-Control "no-store, no-cache, must-revalidate" always;
|
|
add_header Pragma "no-cache" always;
|
|
add_header Expires "0" always;
|
|
|
|
# 禁用 Nginx 自身缓存
|
|
proxy_no_cache 1;
|
|
proxy_cache_bypass 1;
|
|
|
|
upstream next_dashboard {
|
|
server 127.0.0.1:3001;
|
|
keepalive 16;
|
|
}
|
|
|
|
upstream account_service {
|
|
server 127.0.0.1:8080;
|
|
keepalive 16;
|
|
}
|
|
|
|
upstream api_service {
|
|
server 127.0.0.1:8090;
|
|
keepalive 16;
|
|
}
|
|
|
|
sendfile on;
|
|
keepalive_timeout 65;
|
|
|
|
# 开启 Gzip (可选)
|
|
gzip on;
|
|
gzip_types text/plain text/css application/json application/javascript application/xml+rss;
|
|
|
|
# 定义日志格式(可选)
|
|
log_format main '$remote_addr - $remote_user [$time_local] '
|
|
'"$request" $status $body_bytes_sent '
|
|
'"$http_referer" "$http_user_agent" '
|
|
'$request_time';
|
|
|
|
# 全局访问日志
|
|
access_log /usr/local/openresty/nginx/logs/access.log main;
|
|
error_log /usr/local/openresty/nginx/logs/error.log warn;
|
|
|
|
# 引入 conf.d 或 sites-available 下的配置
|
|
include conf.d/*.conf;
|
|
include sites-available/*.conf;
|
|
}
|