Library Search
结果页Nginx 日志解析管道
在 技术栈 中找到 8 个匹配结果。
技术栈
技术栈
8 个 Logstash # Logstash Nginx 日志解析管道
## 目标
使用 Logstash 解析 Nginx Access Log,提取结构化字段,写入 Elasticsearch。
## 完整配置
### logstash-nginx.conf
```
input {
# 方案A:读取文件
file {
path => "/var/log/nginx/access*.log"… 3% Docker ed
networks:
- app-network
nginx:
image: nginx:alpine
container_name: nginx-proxy
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends… 3% Nginx # Nginx 反向代理与负载均衡
## 目标
配置 Nginx 作为反向代理,将请求转发到多个后端服务,实现负载均衡。
## 完整配置
### nginx.conf
```nginx
# 主配置
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid… 3% Flask xpensive_data())
```
### 4.3 静态文件优化
```nginx
# Nginx 配置:让 Nginx 直接服务静态文件,不经过 Flask
location /static/ {
alias /app/static/;
expires 30d; # 设置缓存
add_header Cache-Control "public, i… 3% FastAPI - redis
volumes:
pgdata:
```
## 4. Nginx 反向代理配置
```nginx
upstream fastapi {
server 127.0.0.1:8000;
}
server {
listen 443 ssl http2;
server_name api.example.com;
# ... SSL 配置 ..… 3% Django r.log \
--log-level info
```
### 3.3 Nginx 配置
```nginx
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;… 3% Slim 新稳定版
- **Web 服务器**:PHP 内置服务器 / Apache / nginx
## 2. 安装命令
### 创建项目
```bash
composer require slim/slim:"4.*"
composer require slim/psr7
composer require slim/http
```
### 安装常用中间件
```bash
# 路由缓存
com… 2% Istio | | Istio Gateway | Nginx/Kong |
|---|---|---|
| 定位 | 服务网格入口 | 传统 API 网关 |
| 配置方式 | YAML CRD | nginx.conf |
| 动态更新 | 热更新 | 需 reload |
| 东西向流量 | 覆盖 | 不覆盖 |
| 侵入性 | Sidecar | 无侵入 |
## 思考题
1. Sidecar 注… 2%