随笔分类 - nginx
摘要:nginx日志报错 2024/08/20 18:57:43 [error] 8682#8682: *1 "/home/cms/web/dist/index.html" is forbidden (13: Permission denied), client: 10.168.1.30, server:
阅读全文
摘要:nginx下载地址:https://nginx.org/download/ 1.下载 wget https://nginx.org/download/nginx-1.18.0.tar.gz 2.安装依赖 yum -y install gcc gcc-c++ make automake autocon
阅读全文
摘要:一、Nginx配置文件优化 设置nginx进程数,推荐按照cpu数目来指定,一般跟cpu核数相同。 worker_processes 8; 为每个进程分配cpu,上例中将8个进程分配到8个cpu,当然可以写多个,或者将一个进程分配到多个cpu。 worker_cpu_affinity 0001 00
阅读全文
摘要:Https无法连接Nginx,日志报错 *2179 SSL_do_handshake() failed (SSL: error:1420918C:SSL routines:tls_early_post_process_client_hello:version too low) while SSL h
阅读全文
摘要:Nginx try_files 如下所示,当我们有多个HTML文件对应多个URL,想最快把URL中的后缀 .html 去除掉,又不影响其他接口。该怎样做呢? # 未去掉前 https://test.com/about.html https://test.com/home.html https://t
阅读全文
摘要:1.限制访问频率 访问限制需要自带模块包 limit_req_zone ####2.禁止中国IP 禁止中国IP需要用到第三方模块包 geoip_country Nginx配置文件如下 # For more information on configuration, see: # * Official
阅读全文
摘要:location / { # limit_req zone=test_req burst=5 nodelay; return 302 http://$host:3000/; } # 我这里的端口为3000;你可以3000改成其他的端口
阅读全文
摘要:# For more information on configuration, see: # * Official English Documentation: http://nginx.org/en/docs/ # * Official Russian Documentation: http:/
阅读全文