蝙蝠岛资源网 Design By www.hbtsch.com
nginx参数的详细介绍
最近公司的项目中涉及到旧老项目迁移,需要在nginx上做些配置,所以简单学习了下,好记性不如烂笔头,也许可以帮助到大家,
#开启进程数 <=CPU数 worker_processes 1; #错误日志保存位置 #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #进程号保存文件 #pid logs/nginx.pid; #等待事件 events { #每个进程最大连接数(最大连接=连接数x进程数) worker_connections 1024; } http { #文件扩展名与文件类型映射表 include mime.types; #默认文件类型 default_type application/octet-stream; #日志文件输出格式 这个位置相于全局设置 #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #请求日志保存位置 #access_log logs/access.log main; #打开发送文件 sendfile on; #tcp_nopush on; #连接超时时间 #keepalive_timeout 0; keepalive_timeout 65; #打开gzip压缩 #gzip on; #设定请求缓冲 client_header_buffer_size 1k; large_client_header_buffers 4 4k; #设定负载均衡的服务器列表 upstream tomcat-servers { #weigth参数表示权值,权值越高被分配到的几率越大 #max_fails 当有#max_fails个请求失败,就表示后端的服务器不可用,默认为1,将其设置为0可以关闭检查 #fail_timeout 在以后的#fail_timeout时间内nginx不会再把请求发往已检查出标记为不可用的服务器 #这里指定多个源服务器,ip:端口,80端口的话可写可不写 server 127.0.0.1:8080 weight=5 max_fails=2 fail_timeout=600s; #server 127.0.0.2:8080 weight=3 max_fails=2 fail_timeout=600s; } #第一个虚拟主机 server { #监听IP端口 listen 80; #主机名 server_name localhost; #设置字符集 #charset koi8-r; #本虚拟server的访问日志 相当于局部变量 #access_log logs/host.access.log main; #对本server"/"启用负载均衡 location / { #root /root; #定义服务器的默认网站根目录位置 #index index.php index.html index.htm; #定义首页索引文件的名称 proxy_pass http://tomcat-servers; #请求转向tomcat-servers定义的服务器列表 #以下是一些反向代理的配置可删除. # proxy_redirect off; # proxy_set_header Host $host; # proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # client_max_body_size 10m; #允许客户端请求的最大单文件字节数 # client_body_buffer_size 128k; #缓冲区代理缓冲用户端请求的最大字节数, # proxy_connect_timeout 90; #nginx跟后端服务器连接超时时间(代理连接超时) # proxy_send_timeout 90; #后端服务器数据回传时间(代理发送超时) # proxy_read_timeout 90; #连接成功后,后端服务器响应时间(代理接收超时) # proxy_buffer_size 4k; #设置代理服务器(nginx)保存用户头信息的缓冲区大小 # proxy_buffers 4 32k; #proxy_buffers缓冲区,网页平均在32k以下的话,这样设置 # proxy_busy_buffers_size 64k; #高负荷下缓冲大小(proxy_buffers*2) # proxy_temp_file_write_size 64k; #设定缓存文件夹大小,大于这个值,将从upstream服务器传 } location /upload { alias e:/upload; } #设定查看Nginx状态的地址 location /NginxStatus { stub_status on; access_log off; #allow 192.168.0.3; #deny all; #auth_basic "NginxStatus"; #auth_basic_user_file conf/htpasswd; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # 定义错误提示页面 error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { #多监听 # listen 8000; #主机名 # listen somename:8080; # server_name somename alias another.alias; # location / { #WEB文件路径 # root html; #默认首页 # index index.html index.htm; # } #} # HTTPS server HTTPS SSL加密服务器 # #server { # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.html index.htm; # } #} }
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
蝙蝠岛资源网 Design By www.hbtsch.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
蝙蝠岛资源网 Design By www.hbtsch.com
暂无nginx参数的详细介绍的评论...
RTX 5090要首发 性能要翻倍!三星展示GDDR7显存
三星在GTC上展示了专为下一代游戏GPU设计的GDDR7内存。
首次推出的GDDR7内存模块密度为16GB,每个模块容量为2GB。其速度预设为32 Gbps(PAM3),但也可以降至28 Gbps,以提高产量和初始阶段的整体性能和成本效益。
据三星表示,GDDR7内存的能效将提高20%,同时工作电压仅为1.1V,低于标准的1.2V。通过采用更新的封装材料和优化的电路设计,使得在高速运行时的发热量降低,GDDR7的热阻比GDDR6降低了70%。
更新日志
2024年10月05日
2024年10月05日
- 群星《前途海量 电影原声专辑》[FLAC/分轨][227.78MB]
- 张信哲.1992-知道新曲与精丫巨石】【WAV+CUE】
- 王翠玲.1995-ANGEL【新艺宝】【WAV+CUE】
- 景冈山.1996-我的眼里只有你【大地唱片】【WAV+CUE】
- 群星《八戒 电影原声带》[320K/MP3][188.97MB]
- 群星《我的阿勒泰 影视原声带》[320K/MP3][139.47MB]
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[320K/MP3][148.91MB]
- 刘雅丽.2001-丽花皇后·EMI精选王【EMI百代】【FLAC分轨】
- 齐秦.1994-黄金十年1981-1990CHINA.TOUR.LIVE精丫上华】【WAV+CUE】
- 群星.2008-本色·百代音乐人创作专辑【EMI百代】【WAV+CUE】
- 群星.2001-同步过冬AVCD【环球】【WAV+CUE】
- 群星.2020-同步过冬2020冀待晴空【环球】【WAV+CUE】
- 沈雁.1986-四季(2012梦田复刻版)【白云唱片】【WAV+CUE】
- 纪钧瀚《胎教古典音乐 钢琴与大提琴的沉浸时光》[FLAC/分轨][257.88MB]
- 《国语老歌 怀旧篇 3CD》[WAV/分轨][1.6GB]