惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Darknet – Hacking Tools, Hacker News & Cyber Security
N
News and Events Feed by Topic
N
News | PayPal Newsroom
SecWiki News
SecWiki News
P
Privacy International News Feed
T
Troy Hunt's Blog
Attack and Defense Labs
Attack and Defense Labs
N
News and Events Feed by Topic
L
LINUX DO - 热门话题
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Security Latest
Security Latest
AWS News Blog
AWS News Blog
S
Secure Thoughts
W
WeLiveSecurity
H
Heimdal Security Blog
T
Threat Research - Cisco Blogs
I
Intezer
Application and Cybersecurity Blog
Application and Cybersecurity Blog
S
Security @ Cisco Blogs
G
GRAHAM CLULEY
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Spread Privacy
Spread Privacy
L
Lohrmann on Cybersecurity
C
CERT Recently Published Vulnerability Notes
S
Security Affairs
Hacker News - Newest:
Hacker News - Newest: "LLM"
Google Online Security Blog
Google Online Security Blog
Cisco Talos Blog
Cisco Talos Blog
雷峰网
雷峰网
Cloudbric
Cloudbric
Y
Y Combinator Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园_首页
Hacker News: Ask HN
Hacker News: Ask HN
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Google DeepMind News
Google DeepMind News
Vercel News
Vercel News
云风的 BLOG
云风的 BLOG
Latest news
Latest news
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
D
Docker
Recent Announcements
Recent Announcements
博客园 - 【当耐特】
H
Help Net Security
博客园 - 司徒正美
TaoSecurity Blog
TaoSecurity Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
C
Check Point Blog
博客园 - 叶小钗

NGINX

有用 Nginx UI 的朋友吗?这玩意是不是时不时将磁盘 IO 打满? fail2ban 保护 nginx 方案 - V2EX 麦当劳服务模式是 nginx,肯德基服务模式是 apache,这样理解对不对? - V2EX oracleusa.ml 的实现原理 - V2EX 尝试自己配置转发后端请求的时候有个疑问 - V2EX 请教 Nginx 时完整的 SSL 刷新教程或者脚本 - V2EX 问问大家 nginx 日志流量分析用什么方案? - V2EX nginx 二级目录反向代理是不是有先天缺陷? - V2EX nginx rewrite 指令的问题 - V2EX 问个 nginx 配置问题 - V2EX 请问下为啥微信客户端访问到 nginx 没有参数了? - V2EX 有兄弟们用 nginx proxy manager(或者其他图形化工具)来管理 nginx 反向代理的吗? - V2EX 请问 Nginx 怎么添加 CORS 白名单? - V2EX 使用 nginx 监听已被监听的端口, reload 不会失败, 但会导致其他配置不生效. - V2EX nginx 如何获取/打印完整代理路径? - V2EX Nginx 四层反代 QUIC 如何传递客户端 IP - V2EX 关于 windows 下面重启之后 nginx 的问题 - V2EX 我是不是可以反向代理个 V2EX 网站? - V2EX 用 nginx 做的 xai 的转发好像一直有问题 - V2EX 请教一个 Nginx 配置和浏览器强制 http 转 https 问题 - V2EX nginx proxy manager ipv6 反代指向内网 ipv4 局域网地址,还可以这样操作🤔? - V2EX 关于 Nginx 反向代理性能调优的问题,求指导🙏 - V2EX nginx 配置根据请求头分发问题 - V2EX 用过 nginx-proxy-manager 请进, 咨询个问题. - V2EX 我有一个端口转发问题,求大佬们协助 - V2EX 使用 Nginx 代理 Emby 服务器,浏览器可以访问但是客户端连不上 - V2EX 小白在使用 Nginx proxy manager 遇到问题,请大佬们指教。 - V2EX 请教下 nginx 反代配置 - V2EX nginx 配置问题求解答 - V2EX Nginx 流量异常,请大佬支招~ - V2EX nginx 读取 ssl 证书的权限问题请教 - V2EX 请问一个二级域名如何配置可以访问多个 http 服务? - V2EX 配置证书相关的问题 - V2EX 关于 nginx 的一些提问 - V2EX nginx 限流失败的奇怪问题 - V2EX 反向代理提示该网站已被拦截,请教 - V2EX 为什么我的 docker nginx 的不能反向代理 favicon 啊 - V2EX Nginx 能不能实现按域名限制网速? - V2EX 请教一下各位关于 nginx 版本更新区别导致反向代理无法访问的问题 - V2EX 虚心请教一个有关于 nginx 配置的问题 - V2EX 求解 nginx 反代某堡垒机 443 页面出现问题 - V2EX nginx if 语句 return 403,没办法跳转自定义 403 页面 - V2EX 请教 nginx deny 优先级的问题。 - V2EX 求教关于反代的问题 - V2EX 有台生产服务器, Nginx 每天都会因为不同原因 exit 一次,虽然配了自动重启,有没办法排查是什么原因?平均一天 1820 万请求 - V2EX openresty 怎么修改代理站的文件返回给客户端 有啥平替 resend、ZeptoMail 的国内解决方案嘛? 求救:屏蔽爬虫试了 2 天,没成功 - V2EX
nginx 增加 http 块 就报证书错误,请问是什么原因,第一次见 - V2EX
xinzi · 2024-08-19 · via NGINX

这是一个创建于 664 天前的主题,其中的信息可能已经有所发展或是发生改变。

域名已经处理 不增加 http 块,可以正常访问,证书正常,增加了 http 块就报证书错误,请教一下。全部都 docker 启动 我的 nginx 配置 如下

worker_processes auto; # 自动设置为 CPU 核心数
worker_rlimit_nofile 100000; # 增加每个 worker 进程可以打开的文件数

events {
  worker_connections 4096; # 增加每个 worker 进程的最大连接数
  multi_accept on; # 允许每个 worker 进程同时接受多个连接
}

http {
  include /etc/nginx/mime.types;
  default_type application/octet-stream;
  sendfile on;
  keepalive_timeout 65;
  gzip on;

  server {
    listen 80;
    server_name es.x.com.cn;
    return 301 https://$server_name$request_uri;
  }

  server {
    listen 443 ssl;
    server_name es.x.com.cn;

    # SSL 证书和密钥配置
    ssl_certificate /usr/share/nginx/html/ssl-qianduan/es.x.com.cn_bundle.pem;
    ssl_certificate_key /usr/share/nginx/html/ssl-qianduan/es.x.com.cn.key;

    # SSL 优化配置
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256';
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    ssl_stapling on;
    ssl_stapling_verify on;

    location / {
      root /usr/share/nginx/html; # 路径改成自己的 dist 路径
      index index.html index.htm;
      try_files $uri $uri/ /index.html; #解决刷新页面变成 404 问题的代码
    }

    location /prod-api/ {
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header REMOTE-HOST $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://172.16.238.13:8089/;
    }
  }

  server {
    listen 80;
    server_name esb.x.com.cn;
    return 301 https://$server_name$request_uri;
  }

  server {
    listen 443 ssl;
    server_name esb.x.com.cn;

    # SSL 证书和密钥配置
    ssl_certificate /usr/share/nginx/html/ssl-houduan/esb.x.com.cn_bundle.pem;
    ssl_certificate_key /usr/share/nginx/html/ssl-houduan/esb.x.com.cn.key;

    location / {
      proxy_set_header Host $http_host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header REMOTE-HOST $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://172.16.238.13:8089/;
    }
  }

  # 阻止通过 IP 地址或未知的域名访问
  server {
    listen 80 default_server;
    listen 443 default_server ssl;

    # SSL 证书和密钥配置
    ssl_certificate /usr/share/nginx/html/ssl-houduan/esb.x.com.cn_bundle.pem;
    ssl_certificate_key /usr/share/nginx/html/ssl-houduan/esb.x.com.cn.key;

    server_name es.x.com.cn;
    return 444; # 返回一个非标准的状态码,通常用于阻止客户端的访问
  }
}

  • HTTP
  • 证书
  • 错误

    11 条回复    2024-08-20 07:36:41 +08:00

    Dragonish3600

    1

    Dragonish3600      2024 年 8 月 19 日 via iPhone

    你好歹把具体的错误信息发出来啊……

    xinzi

    3

    xinzi      2024 年 8 月 19 日


    ```
    worker_processes auto; # 自动设置为 CPU 核心数
    worker_rlimit_nofile 100000; # 增加每个 worker 进程可以打开的文件数

    events {
    worker_connections 4096; # 增加每个 worker 进程的最大连接数
    multi_accept on; # 允许每个 worker 进程同时接受多个连接
    }

    http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;
    gzip on;
    ```
    去掉就可以正常访问,加上就报错 没有证书

    Alucns

    4

    Alucns      2024 年 8 月 19 日

    @xinzi /usr/share/nginx/html/ssl-houduan/ 检查看看有没证书

    Alucns

    5

    Alucns      2024 年 8 月 19 日

    nginx -t 把错误报告发上来吧。

    YaD2x

    7

    YaD2x      2024 年 8 月 19 日

    /etc/nginx/conf.d/default.conf is not a file or does not exist

    f1ush

    8

    f1ush      2024 年 8 月 19 日

    @xinzi nginx.conf 文件写重复了吧,默认 nginx.conf 路径是 /etc/nginx/nginx.conf ,看你的报错是 /etc/nginx/conf.d/nginx.conf 路径下面又有一个了

    darkengine

    9

    darkengine      2024 年 8 月 19 日

    [emerg] 1#1: "worker_processes" directive is not allowed here in /etc/nginx/conf.d/nginx.conf:1

    不是提了第一行有问题?

    default.conf 那个只是 info ,不用管。

    xinzi

    11

    xinzi      2024 年 8 月 20 日

    @ladypxy @Aluhao @darkengine @YaD2x @f1ush
    感谢各位
    找到问题了
    nginx 有 2 哥配置文件 一个是 /etc/nginx/nginx.conf 一个是 /etc/nginx/conf.d/nginx.conf

    因此
    worker_processes auto; # 自动设置为 CPU 核心数
    worker_rlimit_nofile 100000; # 增加每个 worker 进程可以打开的文件数

    参数需要配置在 /etc/nginx/nginx.conf 而不是 /etc/nginx/conf.d/nginx.conf
    这 2 个参数是全局参数