nginx配置环境
server {
listen 80;
server_name “域名”;
root 文件地址;
index index.php;
charset utf-8;
sendfile off;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_comp_level 2;
gzip_types application/json;
gzip_vary on;
gzip_disable "MSIE [1-6]\.";
client_max_body_size 20m;
set $trace_id $http_x_trace_id; #日志加上trace_id,前端传一个request_id
if ($trace_id = '') {
set $trace_id $request_id;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
}
access_log /data/wwwlogs/access_crm-api.xiaotangketang.com.log json_format;
error_log /data/wwwlogs/error_crm-api.xiaotangketang.com.log;
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param APP_ENV test; # 读取的配置文件
fastcgi_param HTTP_X_TRACE_ID $trace_id;
}
}
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· 字符编码:从基础到乱码解决
· SpringCloud带你走进微服务的世界