个人主页搭建部署过程

it不难
2022-06-16 / 0 评论 / 25 阅读 / 正在检测是否收录...

前言

参考github项目

部署过程

准备域名

申请免费证书

修改index.html

nginx配置

  server {
    listen 443 ssl http2;
    server_name me.itbunan.xyz;
    server_tokens off;
    ssl_certificate /etc/nginx/cert/me.itbunan.xyz_bundle.crt;
    ssl_certificate_key /etc/nginx/cert/me.itbunan.xyz.key;
    ssl_protocols TLSv1.2 TLSv1.3;
    #add_header X-Content-Type-Options nosniff;
    add_header X-XSS-Protection "1; mode=block";
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
    listen 80;
    if ($scheme = http) {
      return 301 https://$host:443$request_uri;
    }

    root  /opt/www/me/;
    index index.html;

    location ~ .*\.(js|css)?$ {
        expires      12h;
    }
  }

访问

https://me.itbunan.xyz/ 访问">

0

评论 (0)

取消