mirror of
https://gitee.com/ulthon/ulthon_admin.git
synced 2026-08-30 12:45:32 +08:00
feat(nginx-log): 4 个 stack 模板增加 log_format 与 access_log 配置(Docker 开箱即用)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# ulthon_admin nginx_log 分析专用 log_format
|
||||
# 必须放在 nginx 的 http 块(通过 conf.d/*.conf 自动 include)
|
||||
log_format analytics '$remote_addr - $remote_user [$time_local] '
|
||||
'"$request" $status $body_bytes_sent '
|
||||
'"$http_referer" "$http_user_agent" '
|
||||
'$request_time $upstream_response_time $bytes_sent';
|
||||
@@ -14,6 +14,9 @@ server {
|
||||
# 运行时长不限制
|
||||
fastcgi_read_timeout 60000;
|
||||
|
||||
# ulthon_admin nginx_log 分析:access_log 写到 runtime(持久化 + PHP 必能读)
|
||||
access_log /var/www/html/runtime/nginx/access.log analytics;
|
||||
|
||||
location / {
|
||||
if (!-e $request_filename) {
|
||||
rewrite ^(.*)$ /index.php?s=$1 last; break;
|
||||
|
||||
@@ -24,6 +24,13 @@ mkdir -p /var/www/html/storage && chmod -R 777 /var/www/html/storage
|
||||
mkdir -p /var/www/html/memoryspace && chown -R www-data:www-data /var/www/html/memoryspace
|
||||
|
||||
|
||||
# 复制 nginx_log 分析的 log_format 配置到 nginx http 块(conf.d 自动 include)
|
||||
cp "$SCRIPT_DIR/nginx-log-format.conf" /etc/nginx/conf.d/
|
||||
|
||||
# 创建 nginx access_log 目录(必须在 service nginx start 之前)
|
||||
mkdir -p /var/www/html/runtime/nginx && chmod 777 /var/www/html/runtime/nginx
|
||||
|
||||
|
||||
# 运行redis
|
||||
# nohup redis-server --requirepass "" &
|
||||
|
||||
|
||||
Reference in New Issue
Block a user