high-concurent-load
  • Introduction
  • CDN分流+ 加速
    • CDN工作原理
    • CDN核心概念
    • CDN缓存更新策略
    • CDN实战
    • DNS与CDN联系
  • DNS分流
    • DNS介绍
    • DNS配置实战
    • 域名服务模式介绍
  • LVS
    • LVS核心概念
    • LVS实战
  • Nginx教程
    • nginx常见问题汇总
    • nginx注册系统服务
    • nginx安装
    • nginx基础知识
      • nginx工作原理
      • nginx代理
      • nginx的location匹配规则
      • nginx的location匹配实战
      • nginx负载均衡
      • nginx配置expires
      • nginx配置中指令root和alias的区别浅析
    • nginx实战
      • nginx配置文件引用示例
      • nginx超时时间设置
      • nginx实现请求的负载均衡 + keepalived实现nginx的高可用
      • nginx 在已安装的情况下 安装http_image_filter_module
      • nginx配置单个端口对应多个server
      • nginx proxy_pass 路径匹配、URL 重写
      • nginx+tomcat实现动静分离
Powered by GitBook
On this page
  • 页面乱码解决方法
  • nginx 配置文件.*conf 编码的问题
  • nginx报错 *441119082 client intended to send too large body: 1331696 bytes
  • 1.在配置文件入口中的http段落中添加对文件上传的限制 client_max_body_size 100m;
  • 2.在配置文件中location段落中添加对文件上传的限制 client_max_body_size 100m
  • nginx 安装时 make: 没有规则可以创建“default”需要的目标“build” 的解决方案
  • /usr/local/src/pcre-8.35/missing: line 81: aclocal-1.14: command not found

Was this helpful?

  1. Nginx教程

nginx常见问题汇总

页面乱码解决方法

在server段里加以下两行

default_type 'text/html';
charset utf-8;

然后重启就行了

sudo nginx -s reload

nginx 配置文件.*conf 编码的问题

  • Linux:一般采用UTF-8-BOM编码 文本编辑时就可以保存

  • Windows: 一般采用UTf-8编码 文本编辑时就可以保存

避免出现如下问题

Nginx:[emerg] unknown directive “server”
invalid number of arguments in "root" directive  

如果出现,解决方式 root后面那一行数据加分号

nginx报错 *441119082 client intended to send too large body: 1331696 bytes

1.在配置文件入口中的http段落中添加对文件上传的限制 client_max_body_size 100m;

vim /usr/local/nginx/conf/nginx.conf
http {
    include       mime.types;
    server_tokens off;

    sendfile    on;
    tcp_nopush  on;
    tcp_nodelay on;
    keepalive_timeout  65;

    log_format  main  '$proxy_add_x_forwarded_for  $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for" '
                      'upstream: $upstream_addr';
    access_log off;

    client_max_body_size 100m;

2.在配置文件中location段落中添加对文件上传的限制 client_max_body_size 100m

vim /usr/local/nginx/conf/nginx.conf
location /group1/M00 {
    root   /data/fastdfs/data;
    include gzip.conf;
    ngx_fastdfs_module;
    client_max_body_size 100m;
    expires 12h;
}

location /group2/M00 {
    root   /data/fastdfs_group2/data;
    ngx_fastdfs_module;
    client_max_body_size 100m;
    #access_log /usr/local/nginx/logs/group2_pic.log main;
    expires 12h;
    include gzip.conf;
}

nginx 安装时 make: 没有规则可以创建“default”需要的目标“build” 的解决方案

提前安装 zlib 和 pcr

/usr/local/src/pcre-8.35/missing: line 81: aclocal-1.14: command not found

autoreconf -ivf
PreviousNginx教程Nextnginx注册系统服务

Last updated 2 years ago

Was this helpful?