小编Lee*_*ope的帖子

github.io 的 Nginx 代理返回 404

我正在尝试使用 Nginx 作为我在 github 页面上的页面的反向代理。根据此处的信息:https : //pascal.io/github-pages-https/和其他人,我的配置如下所示:

server {
     listen 80 default_server;
    server_name leepope.com www.leepope.com;
    return 301 https://$host$request_uri;
}

server {
  listen 443 ssl http2;
  server_name leepope.com;


  ssl                 on;
  ssl_certificate     <my cert>;
  ssl_certificate_key <my key>;
  ssl_dhparam         /etc/ssl/certs/dhparam.pem;

  ssl_protocols        TLSv1 TLSv1.1 TLSv1.2;
  ssl_ciphers          HIGH:!aNULL:!MD5;
  ssl_session_cache    shared:SSL:10m;
  ssl_prefer_server_ciphers   on;

  add_header Strict-Transport-Security max-age=15768000;


  location / {
    proxy_pass              https://leepope.github.io;
    proxy_set_header        Host               $host;
    proxy_set_header        X-Real-IP          $remote_addr;
    proxy_set_header        X-Forwarded-For    $proxy_add_x_forwarded_for;
    proxy_intercept_errors  on;
    expires                 off;
  } 
}
Run Code Online (Sandbox Code Playgroud)

当我向服务器根目录发出请求时,我得到了一个 github 页面,但它是 404。

我已经启用了 nginx 调试,但是我看不到发送到 github …

reverse-proxy nginx github-pages

6
推荐指数
0
解决办法
627
查看次数

标签 统计

github-pages ×1

nginx ×1

reverse-proxy ×1