Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2008/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
github.io的Nginx代理返回404_Nginx_Reverse Proxy_Github Pages - Fatal编程技术网

github.io的Nginx代理返回404

github.io的Nginx代理返回404,nginx,reverse-proxy,github-pages,Nginx,Reverse Proxy,Github Pages,我正在尝试使用Nginx作为github页面的反向代理。根据此处提供的信息:,以及其他信息,我的配置如下所示: 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;

我正在尝试使用Nginx作为github页面的反向代理。根据此处提供的信息:,以及其他信息,我的配置如下所示:

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;
  } 
}
服务器{
监听80个默认_服务器;
服务器名称leepope.com www.leepope.com;
返回301 https://$host$request\u uri;
}
服务器{
监听443sslhttp2;
服务器名称leepope.com;
ssl-on;
ssl_证书;
ssl_证书_密钥;
ssl_dhparam/etc/ssl/certs/dhparam.pem;
ssl_协议TLSv1 TLSv1.1 TLSv1.2;
ssl_密码高:!aNULL:!MD5;
ssl_会话_缓存共享:ssl:10m;
ssl首选服务器上的密码;
添加_头严格传输安全最大年龄=15768000;
地点/{
代理通行证https://leepope.github.io;
代理设置头主机$Host;
代理集头X-Real-IP$remote\u addr;
proxy\u set\u header X-Forwarded-For$proxy\u add\u X\u Forwarded\u For;
上的代理截获错误;
过期;
} 
}
当我向服务器根目录发出请求时,我得到一个github页面,但它是404

我已经启用了nginx调试,但是我看不到发送到github的请求是什么样子的-它们的头在日志中,但是没有关于发生了什么的信息

有人能帮我解决这个问题吗


谢谢

您是否已尝试使用:
proxy\u pass在后端禁用httpshttp://leepope.github.io;
$host
替换为
代理集标题上的
leepope.github.io“