侧边栏壁纸
博主头像
可乐呢o3o博主等级

少些比较,多些谦虚。

  • 累计撰写 49 篇文章
  • 累计创建 71 个标签
  • 累计收到 0 条评论

目 录CONTENT

文章目录

Nginx自用反代模板

Evan
2024-04-01 / 0 评论 / 0 点赞 / 63 阅读 / 1921 字

nginx 自用配置模板

server {
    listen 80;
    server_name example.liukersun.com;
    return 301 https://$host$request_uri;
}
server {
    listen 443 ssl;
    server_name example.liukersun.com;
    ssl_certificate /etc/ssl/example.liukersun.com/fullchain.pem;
    ssl_certificate_key /etc/ssl/example.liukersun.com/key.pem;
    # SSL configuration
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
    # ssl_prefer_server_ciphers on;
    # ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    # HSTS (optional)
    # add_header Strict-Transport-Security "max-age=31536000" always;

    location / {
        proxy_pass http://localhost:10086;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_cache_bypass $http_upgrade;
    }
}

链接

ln -s /etc/nginx/sites-available/example.liukersun.com /etc/nginx/sites-enabled/
0

评论区