首页 > 编程知识 正文

springboot配置文件详解教程,菜鸟教程环境配置

时间:2023-05-06 20:31:52 阅读:282622 作者:3014

########### 每个指令必须有分号结束。#################
#user administrator administrators; #配置用户或者组,默认为nobody nobody。
#worker_processes 2; #允许生成的进程数,默认为1
#pid /nginx/pid/nginx.pid; #指定nginx进程运行文件存放地址
error_log log/error.log debug; #制定日志路径,级别。这个设置可以放入全局块,http块,server块,级别以此为:debug|info|notice|warn|error|crit|alert|emerg
events {
accept_mutex on; #设置网路连接序列化,防止惊群现象发生,默认为on
multi_accept on; #设置一个进程是否同时接受多个网络连接,默认为off
#use epoll; #事件驱动模型,select|poll|kqueue|epoll|resig|/dev/poll|eventport
worker_connections 1024; #最大连接数,默认为512
}
http {
include mime.types; #文件扩展名与文件类型映射表
default_type application/octet-stream; #默认文件类型,默认为text/plain
#access_log off; #取消服务日志
log_format myFormat ' r e m o t e a d d r – remote_addr– remotea​ddr–remote_user [$time_local] $request $status $body_bytes_sent $http_referer $http_user_agent KaTeX parse error: Double subscript at position 7: http_x_̲forwarded_for';… { #请求的url过滤,正则匹配,为区分大小写,*为不区分大小写。
#root path; #根目录
#index vv.txt; #设置默认页
proxy_pass http://mysvr; #请求转向mysvr 定义的服务器列表
deny 127.0.0.1; #拒绝的ip
allow 172.18.5.54; #允许的ip
}
}
}

几个常见配置项:
• 1.$remote_addr 与 KaTeX parse error: Double subscript at position 7: http_x_̲forwarded_for 用…remote_user :用来记录客户端用户名称;
• 3. t i m e l o c a l : 用 来 记 录 访 问 时 间 与 时 区 ; • 4. time_local : 用来记录访问时间与时区; • 4. timel​ocal:用来记录访问时间与时区;•4.request : 用来记录请求的url与http协议;
• 5. s t a t u s : 用 来 记 录 请 求 状 态 ; 成 功 是 200 ; • 6. status : 用来记录请求状态;成功是200; • 6. status:用来记录请求状态;成功是200;•6.body_bytes_s ent :记录发送给客户端文件主体内容大小;
• 7. h t t p r e f e r e r : 用 来 记 录 从 那 个 页 面 链 接 访 问 过 来 的 ; • 8. http_referer :用来记录从那个页面链接访问过来的; • 8. httpr​eferer:用来记录从那个页面链接访问过来的;•8.http_user_agent :记录客户端浏览器的相关信息;

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。