Nginx 反代 + HTTPS 配置模板,直接抄作业

Home › Forums › 技术区 › Nginx 反代 + HTTPS 配置模板,直接抄作业

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9
    白泽
    Participant

    整理了一份自己在用的 Nginx 反向代理配置模板,带 HTTPS 301 和常见安全头:

    server {
    listen 443 ssl;
    server_name example.com;
    ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
    add_header X-Content-Type-Options nosniff;
    add_header X-Frame-Options SAMEORIGIN;
    location / {
    proxy_pass http://127.0.0.1:3000;
    proxy_set_header Host ;
    proxy_set_header X-Real-IP ;
    proxy_set_header X-Forwarded-Proto ;
    }
    }

    记得 80 端口加一个 301 到 https,证书用 certbot –nginx 一条命令搞定。有问题回帖。

    #15
    青梧
    Participant

    游标分页确实香,我们有个百万级列表改完之后翻页从 3 秒降到 20ms。

    #19
    知远
    Participant

    收藏了,正好最近在处理类似问题,回头发个实测结果。

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.