博客底部的hitokoto最开始使用的是Andy1999菊苣搭建的,前几天发现挂掉了,打算用官方的API时发现SSL证书过期都一年多了bae125d609ef5512a9cedfe79cfdbbb2.jpg

就给hitokoto官方API弄了个反代太复杂的也不会

如果有同样问题的可以直接使用咱反代好的,只支持https.说的好像有人会看到一样(ಥ_ಥ)

https://hitokoto.tse.moe/

当然自己反代也很简单,以下是nginx的配置,修改一下域名,证书即可

server
 {
      listen  443 ssl http2;
      server_name  hitokoto.tse.moe;

      ssl_certificate /etc/nginx/ssl/tse.moe.crt;
      ssl_certificate_key /etc/nginx/ssl/tse.moe.key;
ssl_dhparam /etc/nginx/ssl/dhparam.pem;
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
    ssl_stapling on;
    ssl_ciphers "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA";
    ssl_prefer_server_ciphers on;
    add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload";

      location / {

      proxy_redirect off;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_pass http://api.hitokoto.us/rand;
      }

 }

看看效果(´ ・ω・`)