爬行的蜗牛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: golang Linux PHP
查看: 2200|回复: 8

Nginx反向代理github

[复制链接]

94

主题

36

回帖

849

积分

管理员

积分
849
发表于 2023-10-9 22:23:21 | 显示全部楼层 |阅读模式
github.com
  1. upstream github {
  2.     server github.com:443;
  3.     keepalive 32;
  4. }
  5. server
  6. {
  7.     listen 80;
  8.                 listen 443 ssl http2;
  9.     server_name hub.205b.com;
  10.     index index.php index.html index.htm default.php default.htm default.html;
  11.     root /www/wwwroot/hub.205b.com;

  12.     #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  13.     #error_page 404/404.html;
  14.     #HTTP_TO_HTTPS_START
  15.     if ($server_port !~ 443){
  16.         rewrite ^(/.*)$ https://$host$1 permanent;
  17.     }
  18.     #HTTP_TO_HTTPS_END
  19.     ssl_certificate    /www/server/panel/vhost/cert/hub.205b.com/fullchain.pem;
  20.     ssl_certificate_key    /www/server/panel/vhost/cert/hub.205b.com/privkey.pem;
  21.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  22.     ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  23.     ssl_prefer_server_ciphers on;
  24.     ssl_session_cache shared:SSL:10m;
  25.     ssl_session_timeout 10m;
  26.     add_header Strict-Transport-Security "max-age=31536000";
  27.     error_page 497  https://$host$request_uri;

  28.     #SSL-END
  29.     gzip on;
  30.     gzip_min_length 1k;
  31.     gzip_buffers 4 16k;
  32.     gzip_http_version 1.1;
  33.     gzip_comp_level 2;
  34.     gzip_vary on;
  35.     gzip_proxied any; # test required
  36.     gzip_types
  37.         text/plain
  38.         text/css
  39.         text/js
  40.         text/xml
  41.         text/javascript
  42.         application/javascript
  43.         application/json
  44.         application/xml
  45.         application/rss+xml
  46.         image/svg+xml;

  47.     # SSL
  48.     location ~ \.well-known {
  49.         allow all;
  50.     }

  51.     # releases download
  52.     location ~ ^/[^/]+/[^/]+/releases/download/ {
  53.         return 301 https://download.205b.com$request_uri;
  54.     }

  55.     # archive download
  56.     location ~ ^/[^/]+/[^/]+/archive/ {
  57.         return 301 https://archive.205b.com$request_uri;
  58.     }
  59.    
  60.     location ~ ^/[^/]+/[^/]+/suites/[^/]+/artifacts/ {
  61.         return 301 https://download.205b.com$request_uri;
  62.     }

  63.     # Fuck Search Engine
  64.     location /robots.txt {
  65.         allow all;
  66.     }
  67.    
  68.     location / {
  69.         proxy_hide_header referrer-policy;
  70.         proxy_hide_header content-security-policy;
  71.         proxy_hide_header Strict-Transport-Security;
  72.         proxy_hide_header x-pjax-url;

  73.         proxy_set_header Host github.com;
  74.         proxy_set_header Accept-Encoding "";
  75.         proxy_set_header Referer https://github.com/;
  76.         proxy_set_header Origin https://github.com;
  77.         #proxy_set_header Connection "";

  78.         add_header x-pjax-url "https://hub.205b.com$request_uri";

  79.         proxy_http_version 1.1;
  80.         proxy_connect_timeout 10s;
  81.         proxy_read_timeout 10s;
  82.         
  83.         # Not supported when installed from Debian source
  84.         # proxy_socket_keepalive on;
  85.         
  86.         proxy_ssl_server_name on;
  87.         
  88.         sub_filter ""https://raw.githubusercontent.com" ""https://raw.205b.com";
  89.         sub_filter ""https://github.com" ""https://hub.205b.com";
  90.         sub_filter ""https://github.githubassets.com" ""https://assets.205b.com";
  91.         sub_filter ""https://github.githubassets.com" ""https://assets.205b.com";
  92.         sub_filter ""https://api.github.com" ""https://api.205b.com";
  93.         sub_filter ""https://user-images.githubusercontent.com" ""https://user-images.205b.com";
  94.         sub_filter ""https://customer-stories-feed.github.com" ""https://customer-stories-feed.205b.com";
  95.         sub_filter ""https://avatars.githubusercontent.com" ""https://avatars.205b.com";
  96.         sub_filter_once off;
  97.         
  98.         proxy_cookie_domain github.com hub.205b.com;
  99.         proxy_redirect https://avatars.githubusercontent.com https://avatars.205b.com;
  100.         proxy_redirect https://github.com https://hub.205b.com;
  101.         proxy_redirect https://raw.githubusercontent.com https://raw.205b.com;
  102.         proxy_redirect https://github.githubassets.com https://assets.205b.com;
  103.         proxy_redirect https://customer-stories-feed.github.com https://customer-stories-feed.205b.com;
  104.         proxy_redirect https://user-images.githubusercontent.com https://user-images.205b.com;
  105.         proxy_redirect https://codeload.github.com https://codeload.205b.com;
  106.         proxy_redirect https://api.github.com https://api.205b.com;

  107.         proxy_pass https://github;
  108.     }
  109.     #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
  110.     #error_page 404 /404.html;
  111.     #error_page 502 /502.html;
  112.     #ERROR-PAGE-END

  113.     #PHP-INFO-START  PHP引用配置,可以注释或修改
  114.    

  115.         #清理缓存规则

  116.     location ~ /purge(/.*) {
  117.         proxy_cache_purge cache_one $host$1$is_args$args;
  118.         #access_log  /www/wwwlogs/hub.205b.com_purge_cache.log;
  119.     }
  120.         #引用反向代理规则,注释后配置的反向代理将无效
  121.         include /www/server/panel/vhost/nginx/proxy/hub.205b.com/*.conf;

  122.         include enable-php-00.conf;
  123.     #PHP-INFO-END

  124.     #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  125.     include /www/server/panel/vhost/rewrite/hub.205b.com.conf;
  126.     #REWRITE-END

  127.     #禁止访问的文件或目录
  128.     location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
  129.     {
  130.         return 404;
  131.     }

  132.     #一键申请SSL证书验证目录相关设置
  133.     location ~ \.well-known{
  134.         allow all;
  135.     }

  136.     #禁止在证书验证目录放入敏感文件
  137.     if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
  138.         return 403;
  139.     }

  140.     access_log  /www/wwwlogs/hub.205b.com.log;
  141.     error_log  /www/wwwlogs/hub.205b.com.error.log;
  142. }
复制代码


94

主题

36

回帖

849

积分

管理员

积分
849
 楼主| 发表于 2023-10-9 22:23:59 | 显示全部楼层
raw.github.com
  1. upstream rawgithub {
  2.     server raw.githubusercontent.com:443;
  3.     keepalive 32;
  4. }
  5. server
  6. {
  7.     listen 80;
  8.                 listen 443 ssl http2;
  9.     server_name raw.205b.com;
  10.     index index.php index.html index.htm default.php default.htm default.html;
  11.     root /www/wwwroot/raw.205b.com;

  12.     #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  13.     #error_page 404/404.html;
  14.     #HTTP_TO_HTTPS_START
  15.     if ($server_port !~ 443){
  16.         rewrite ^(/.*)$ https://$host$1 permanent;
  17.     }
  18.     #HTTP_TO_HTTPS_END
  19.     ssl_certificate    /www/server/panel/vhost/cert/raw.205b.com/fullchain.pem;
  20.     ssl_certificate_key    /www/server/panel/vhost/cert/raw.205b.com/privkey.pem;
  21.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  22.     ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  23.     ssl_prefer_server_ciphers on;
  24.     ssl_session_cache shared:SSL:10m;
  25.     ssl_session_timeout 10m;
  26.     add_header Strict-Transport-Security "max-age=31536000";
  27.     error_page 497  https://$host$request_uri;

  28.     #SSL-END
  29. error_page 497  https://$host$request_uri;
  30. # SSL
  31.     location ~ \.well-known {
  32.         allow all;
  33.     }

  34.     # Fuck Search Engine
  35.     location /robots.txt {
  36.         allow all;
  37.     }
  38.    
  39.     location / {
  40.         valid_referers none blocked *.fastgit.xyz *.fastgit.org raw.githubusercontent.com github.com;
  41.         if ($invalid_referer){
  42.             return 403;
  43.         }
  44.         proxy_hide_header content-security-policy;
  45.         proxy_hide_header Strict-Transport-Security;
  46.         proxy_hide_header set-cookie;
  47.         proxy_hide_header x-pjax-url;

  48.         proxy_set_header Host raw.githubusercontent.com;
  49.         # proxy_set_header Connection "";

  50.         add_header X-FastGit-Node "dogyun-de-1";

  51.         proxy_http_version 1.1;
  52.         proxy_connect_timeout 5s;
  53.         proxy_read_timeout 5s;

  54.         proxy_pass https://rawgithub;
  55.     }

  56.     #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
  57.     #error_page 404 /404.html;
  58.     #error_page 502 /502.html;
  59.     #ERROR-PAGE-END

  60.     #PHP-INFO-START  PHP引用配置,可以注释或修改
  61.     include enable-php-00.conf;
  62.     #PHP-INFO-END

  63.     #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  64.     include /www/server/panel/vhost/rewrite/raw.205b.com.conf;
  65.     #REWRITE-END

  66.     #禁止访问的文件或目录
  67.     location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
  68.     {
  69.         return 404;
  70.     }

  71.     #一键申请SSL证书验证目录相关设置
  72.     location ~ \.well-known{
  73.         allow all;
  74.     }

  75.     #禁止在证书验证目录放入敏感文件
  76.     if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
  77.         return 403;
  78.     }

  79.     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  80.     {
  81.         expires      30d;
  82.         error_log /dev/null;
  83.         access_log /dev/null;
  84.     }

  85.     location ~ .*\.(js|css)?$
  86.     {
  87.         expires      12h;
  88.         error_log /dev/null;
  89.         access_log /dev/null;
  90.     }
  91.     access_log  /www/wwwlogs/raw.205b.com.log;
  92.     error_log  /www/wwwlogs/raw.205b.com.error.log;
  93. }
复制代码

94

主题

36

回帖

849

积分

管理员

积分
849
 楼主| 发表于 2023-10-9 22:24:30 | 显示全部楼层
download.github.com
  1. upstream GithubDownload {
  2.     server github.com:443;
  3.     keepalive 32;
  4. }
  5. server
  6. {
  7.     listen 80;
  8.                 listen 443 ssl http2;
  9.     server_name download.205b.com;
  10.     index index.php index.html index.htm default.php default.htm default.html;
  11.     root /www/wwwroot/download.205b.com;

  12.     #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  13.     #error_page 404/404.html;
  14.     #HTTP_TO_HTTPS_START
  15.     if ($server_port !~ 443){
  16.         rewrite ^(/.*)$ https://$host$1 permanent;
  17.     }
  18.     #HTTP_TO_HTTPS_END
  19.     ssl_certificate    /www/server/panel/vhost/cert/download.205b.com/fullchain.pem;
  20.     ssl_certificate_key    /www/server/panel/vhost/cert/download.205b.com/privkey.pem;
  21.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  22.     ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  23.     ssl_prefer_server_ciphers on;
  24.     ssl_session_cache shared:SSL:10m;
  25.     ssl_session_timeout 10m;
  26.     add_header Strict-Transport-Security "max-age=31536000";
  27.     error_page 497  https://$host$request_uri;

  28.     #SSL-END
  29.     error_page 497  https://$host$request_uri;
  30.    

  31.     # SSL
  32.     location ~ \.well-known{
  33.         allow all;
  34.     }
  35.    
  36.     location / {

  37.     }
  38.    
  39.     location ~ ^/[^/]+/[^/]+/releases(/latest)?/download/ {
  40.         proxy_cache_valid 206 120m;
  41.         proxy_cache_valid 200 120m;
  42.         recursive_error_pages on;
  43.         proxy_pass https://GithubDownload;
  44.         proxy_intercept_errors on;
  45.         error_page 301 302 307 = @handle_redirect;
  46.     }
  47.    
  48.     location ~ ^/[^/]+/[^/]+/suites/[^/]+/artifacts/ {
  49.         proxy_cache_valid 206 120m;
  50.         proxy_cache_valid 200 120m;
  51.         recursive_error_pages on;
  52.         proxy_pass https://GithubDownload;
  53.         proxy_intercept_errors on;
  54.         error_page 301 302 307 = @handle_redirect;
  55.     }
  56.    
  57.     location ~ ^/[^/]+/[^/]+/archive/ {
  58.         return 301 https://download.205b.com$request_uri;
  59.     }

  60.     location @handle_redirect {
  61.         resolver 8.8.8.8;
  62.         recursive_error_pages on;
  63.         set $saved_redirect_location '$upstream_http_location';
  64.         proxy_pass $saved_redirect_location;
  65.         proxy_intercept_errors on;
  66.         error_page 301 302 307 = @handle_redirect;
  67.     }
  68.    
  69.     # Block search engine
  70.     if ($http_user_agent ~* "qihoobot|Baiduspider|Bingbot|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot") {
  71.         return 403;
  72.     }
  73.     #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
  74.     #error_page 404 /404.html;
  75.     #error_page 502 /502.html;
  76.     #ERROR-PAGE-END

  77.     #PHP-INFO-START  PHP引用配置,可以注释或修改
  78.     include enable-php-00.conf;
  79.     #PHP-INFO-END

  80.     #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  81.     include /www/server/panel/vhost/rewrite/download.205b.com.conf;
  82.     #REWRITE-END

  83.     #禁止访问的文件或目录
  84.     location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
  85.     {
  86.         return 404;
  87.     }

  88.     #一键申请SSL证书验证目录相关设置
  89.     location ~ \.well-known{
  90.         allow all;
  91.     }

  92.     #禁止在证书验证目录放入敏感文件
  93.   #  if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
  94.    #     return 403;
  95.     #}
  96. #以下禁止注释掉了,以前没注释掉
  97.     #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  98.     #{
  99.      #   expires      30d;
  100.       #  error_log /dev/null;
  101.        # access_log /dev/null;
  102.   #  }

  103.    # location ~ .*\.(js|css)?$
  104.     #{
  105.     #    expires      12h;
  106.      #   error_log /dev/null;
  107.       #  access_log /dev/null;
  108.   #  }
  109.     access_log  /www/wwwlogs/download.205b.com.log;
  110.     error_log  /www/wwwlogs/download.205b.com.error.log;
  111. }
复制代码

94

主题

36

回帖

849

积分

管理员

积分
849
 楼主| 发表于 2023-10-9 22:25:13 | 显示全部楼层
GithubArchive
  1. upstream GithubArchive {
  2.     server github.com:443;
  3.     keepalive 32;
  4. }

  5. server
  6. {
  7.     listen 80;
  8.                 listen 443 ssl http2;
  9.     server_name archive.205b.com;
  10.     index index.php index.html index.htm default.php default.htm default.html;
  11.     root /www/wwwroot/archive.205b.com;

  12.     #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  13.     #error_page 404/404.html;
  14.     #HTTP_TO_HTTPS_START
  15.     if ($server_port !~ 443){
  16.         rewrite ^(/.*)$ https://$host$1 permanent;
  17.     }
  18.     #HTTP_TO_HTTPS_END
  19.     ssl_certificate    /www/server/panel/vhost/cert/archive.205b.com/fullchain.pem;
  20.     ssl_certificate_key    /www/server/panel/vhost/cert/archive.205b.com/privkey.pem;
  21.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  22.     ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  23.     ssl_prefer_server_ciphers on;
  24.     ssl_session_cache shared:SSL:10m;
  25.     ssl_session_timeout 10m;
  26.     add_header Strict-Transport-Security "max-age=31536000";
  27.     error_page 497  https://$host$request_uri;

  28.     #SSL-END
  29.     error_page 497  https://$host$request_uri;

  30.     # SSL
  31.     location ~ \.well-known{
  32.         allow all;
  33.     }
  34.    
  35.     location / {

  36.     }
  37.    
  38.     location ~ ^/[^/]+/[^/]+/releases(/latest)?/download/ {
  39.         return 301 https://download.205b.com$request_uri;
  40.     }
  41.    
  42.     location ~ ^/[^/]+/[^/]+/suites/[^/]+/artifacts/ {
  43.         return 301 https://download.205b.com$request_uri;
  44.     }
  45.    
  46.     location ~ ^/[^/]+/[^/]+/archive/ {
  47.         recursive_error_pages on;
  48.         proxy_pass https://GithubArchive;
  49.         proxy_intercept_errors on;
  50.         error_page 301 302 307 = @handle_redirect;
  51.     }

  52.     location @handle_redirect {
  53.         resolver 8.8.8.8;
  54.         recursive_error_pages on;
  55.         set $saved_redirect_location '$upstream_http_location';
  56.         proxy_pass $saved_redirect_location;
  57.         proxy_intercept_errors on;
  58.         error_page 301 302 307 = @handle_redirect;
  59.     }
  60.    
  61.     # Block search engine
  62.     if ($http_user_agent ~* "qihoobot|Baiduspider|Bingbot|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot") {
  63.         return 403;
  64.     }
  65.     #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
  66.     #error_page 404 /404.html;
  67.     #error_page 502 /502.html;
  68.     #ERROR-PAGE-END

  69.     #PHP-INFO-START  PHP引用配置,可以注释或修改
  70.     include enable-php-00.conf;
  71.     #PHP-INFO-END

  72.     #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  73.     include /www/server/panel/vhost/rewrite/archive.205b.com.conf;
  74.     #REWRITE-END

  75.     #禁止访问的文件或目录
  76.     location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
  77.     {
  78.         return 404;
  79.     }

  80.     #一键申请SSL证书验证目录相关设置
  81.     location ~ \.well-known{
  82.         allow all;
  83.     }

  84.     #禁止在证书验证目录放入敏感文件
  85.     if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
  86.         return 403;
  87.     }

  88.   #  location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  89.   #  {
  90.    #     expires      30d;
  91.     #    error_log /dev/null;
  92.      #   access_log /dev/null;
  93.   #  }

  94.    # location ~ .*\.(js|css)?$
  95.   #  {
  96.    #     expires      12h;
  97.     #    error_log /dev/null;
  98.      #   access_log /dev/null;
  99.   #  }
  100.     access_log  /www/wwwlogs/archive.205b.com.log;
  101.     error_log  /www/wwwlogs/archive.205b.com.error.log;
  102. }
复制代码

94

主题

36

回帖

849

积分

管理员

积分
849
 楼主| 发表于 2023-10-9 22:26:25 | 显示全部楼层
assets.github.com
  1. upstream assetsgithub {
  2.     server assets.github.com:443;
  3.     keepalive 32;
  4. }
  5. server
  6. {
  7.     listen 80;
  8.                 listen 443 ssl http2;
  9.     server_name assets.205b.com;
  10.     index index.php index.html index.htm default.php default.htm default.html;
  11.     root /www/wwwroot/assets.205b.com;

  12.     #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  13.     #error_page 404/404.html;
  14.     #HTTP_TO_HTTPS_START
  15.     if ($server_port !~ 443){
  16.         rewrite ^(/.*)$ https://$host$1 permanent;
  17.     }
  18.     #HTTP_TO_HTTPS_END
  19.     ssl_certificate    /www/server/panel/vhost/cert/assets.205b.com/fullchain.pem;
  20.     ssl_certificate_key    /www/server/panel/vhost/cert/assets.205b.com/privkey.pem;
  21.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  22.     ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  23.     ssl_prefer_server_ciphers on;
  24.     ssl_session_cache shared:SSL:10m;
  25.     ssl_session_timeout 10m;
  26.     add_header Strict-Transport-Security "max-age=31536000";
  27.     error_page 497  https://$host$request_uri;

  28.     #SSL-END
  29.     error_page 497  https://$host$request_uri;

  30.     # SSL
  31.     location ~ \.well-known {
  32.         allow all;
  33.     }
  34.    
  35.     # Fuck Search Engine
  36.     location /robots.txt {
  37.         allow all;
  38.     }
  39.    
  40.     #PROXY-START/
  41.     location ~* \.(php|jsp|cgi|asp|aspx)$
  42.     {
  43.         proxy_pass https://github.githubassets.com;
  44.         proxy_set_header Host github.githubassets.com;
  45.         proxy_set_header X-Real-IP $remote_addr;
  46.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47.         proxy_set_header REMOTE-HOST $remote_addr;
  48.     }
  49.    
  50.     location /
  51.     {
  52.         proxy_pass https://github.githubassets.com;
  53.         proxy_set_header Host github.githubassets.com;
  54.         proxy_set_header X-Real-IP $remote_addr;
  55.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  56.         proxy_set_header REMOTE-HOST $remote_addr;
  57.         add_header X-Cache $upstream_cache_status;
  58.         proxy_ignore_headers Set-Cookie Cache-Control expires;
  59.         # proxy_cache cache_one;
  60.         proxy_cache_key $host$uri$is_args$args;
  61.         proxy_cache_valid 200 304 301 302 480m;
  62.         expires 12h;
  63.     }
  64.     #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
  65.     #error_page 404 /404.html;
  66.     #error_page 502 /502.html;
  67.     #ERROR-PAGE-END

  68.     #PHP-INFO-START  PHP引用配置,可以注释或修改
  69.     include enable-php-00.conf;
  70.     #PHP-INFO-END

  71.     #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  72.     include /www/server/panel/vhost/rewrite/assets.205b.com.conf;
  73.     #REWRITE-END

  74.     #禁止访问的文件或目录
  75.     location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
  76.     {
  77.         return 404;
  78.     }

  79.     #一键申请SSL证书验证目录相关设置
  80.     location ~ \.well-known{
  81.         allow all;
  82.     }

  83.     #禁止在证书验证目录放入敏感文件
  84.     if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
  85.         return 403;
  86.     }

  87.     #location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  88.    # {
  89.    #     expires      30d;
  90.     #    error_log /dev/null;
  91.      #   access_log /dev/null;
  92.     }

  93.   #  location ~ .*\.(js|css)?$
  94.   #  {
  95.    #     expires      12h;
  96.     #    error_log /dev/null;
  97.      #   access_log /dev/null;
  98.   #  }
  99.     access_log  /www/wwwlogs/assets.205b.com.log;
  100.     error_log  /www/wwwlogs/assets.205b.com.error.log;
  101. #}
复制代码

94

主题

36

回帖

849

积分

管理员

积分
849
 楼主| 发表于 2023-10-9 22:27:34 | 显示全部楼层
avatars.205b.com     avatars.githubusercontent.com
  1. upstream avatarsgithub {
  2.     server github.com:443;
  3.     keepalive 32;
  4. }
  5. server
  6. {
  7.     listen 80;
  8.                 listen 443 ssl http2;
  9.     server_name avatars.205b.com;
  10.     index index.php index.html index.htm default.php default.htm default.html;
  11.     root /www/wwwroot/github.205b.com;

  12.     #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  13.     #error_page 404/404.html;
  14.     #HTTP_TO_HTTPS_START
  15.     if ($server_port !~ 443){
  16.         rewrite ^(/.*)$ https://$host$1 permanent;
  17.     }
  18.     #HTTP_TO_HTTPS_END
  19.     ssl_certificate    /www/server/panel/vhost/cert/github.205b.com/fullchain.pem;
  20.     ssl_certificate_key    /www/server/panel/vhost/cert/github.205b.com/privkey.pem;
  21.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  22.     ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  23.     ssl_prefer_server_ciphers on;
  24.     ssl_session_cache shared:SSL:10m;
  25.     ssl_session_timeout 10m;
  26.     add_header Strict-Transport-Security "max-age=31536000";
  27.     error_page 497  https://$host$request_uri;

  28.     #SSL-END
  29.     error_page 497  https://$host$request_uri;

  30.     # SSL
  31.     location ~ \.well-known {
  32.         allow all;
  33.     }
  34.    
  35.     # Fuck Search Engine
  36.     location /robots.txt {
  37.         allow all;
  38.     }
  39.    
  40.     #PROXY-START/
  41.     location ~* \.(php|jsp|cgi|asp|aspx)$
  42.     {
  43.         proxy_pass https://avatars.githubusercontent.com;
  44.         proxy_set_header Host avatars.githubusercontent.com;
  45.         proxy_set_header X-Real-IP $remote_addr;
  46.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47.         proxy_set_header REMOTE-HOST $remote_addr;
  48.     }
  49.    
  50.     location /
  51.     {
  52.         proxy_pass https://avatars.githubusercontent.com;
  53.         proxy_set_header Host avatars.githubusercontent.com;
  54.         proxy_set_header X-Real-IP $remote_addr;
  55.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  56.         proxy_set_header REMOTE-HOST $remote_addr;
  57.         add_header X-Cache $upstream_cache_status;
  58.         proxy_ignore_headers Set-Cookie Cache-Control expires;
  59.         # proxy_cache cache_one;
  60.         proxy_cache_key $host$uri$is_args$args;
  61.         proxy_cache_valid 200 304 301 302 480m;
  62.         expires 12h;
  63.     }
  64.     #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
  65.     #error_page 404 /404.html;
  66.     #error_page 502 /502.html;
  67.     #ERROR-PAGE-END

  68.     #PHP-INFO-START  PHP引用配置,可以注释或修改
  69.    

  70.         include enable-php-00.conf;
  71.     #PHP-INFO-END

  72.     #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  73.     include /www/server/panel/vhost/rewrite/github.205b.com.conf;
  74.     #REWRITE-END

  75.     #禁止访问的文件或目录
  76.     location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
  77.     {
  78.         return 404;
  79.     }

  80.     #一键申请SSL证书验证目录相关设置
  81.     location ~ \.well-known{
  82.         allow all;
  83.     }

  84.     #禁止在证书验证目录放入敏感文件
  85.     if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
  86.         return 403;
  87.     }

  88.     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  89.     {
  90.         expires      30d;
  91.         error_log /dev/null;
  92.         access_log /dev/null;
  93.     }
  94.     location ~ .*\.(js|css)?$
  95.     {
  96.         expires      12h;
  97.         error_log /dev/null;
  98.         access_log /dev/null;
  99.     }
  100.         access_log  /www/wwwlogs/github.205b.com.log;
  101.     error_log  /www/wwwlogs/github.205b.com.error.log;
  102. }
复制代码

94

主题

36

回帖

849

积分

管理员

积分
849
 楼主| 发表于 2023-10-9 22:27:59 | 显示全部楼层
api.github.com
  1. upstream apigithub {
  2.     server github.com:443;
  3.     keepalive 32;
  4. }
  5. server
  6. {
  7.     listen 80;
  8.                 listen 443 ssl http2;
  9.     server_name api.205b.com;
  10.     index index.php index.html index.htm default.php default.htm default.html;
  11.     root /www/wwwroot/api.205b.com;

  12.     #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  13.     #error_page 404/404.html;
  14.     #HTTP_TO_HTTPS_START
  15.     if ($server_port !~ 443){
  16.         rewrite ^(/.*)$ https://$host$1 permanent;
  17.     }
  18.     #HTTP_TO_HTTPS_END
  19.     ssl_certificate    /www/server/panel/vhost/cert/api.205b.com/fullchain.pem;
  20.     ssl_certificate_key    /www/server/panel/vhost/cert/api.205b.com/privkey.pem;
  21.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  22.     ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  23.     ssl_prefer_server_ciphers on;
  24.     ssl_session_cache shared:SSL:10m;
  25.     ssl_session_timeout 10m;
  26.     add_header Strict-Transport-Security "max-age=31536000";
  27.     error_page 497  https://$host$request_uri;

  28.     #SSL-END
  29.     error_page 497  https://$host$request_uri;

  30.     # SSL
  31.     location ~ \.well-known {
  32.         allow all;
  33.     }
  34.    
  35.     # Fuck Search Engine
  36.     location /robots.txt {
  37.         allow all;
  38.     }
  39.    
  40.     #PROXY-START/
  41.     location ~* \.(php|jsp|cgi|asp|aspx)$
  42.     {
  43.         proxy_pass https://api.github.com;
  44.         proxy_set_header Host api.github.com;
  45.         proxy_set_header X-Real-IP $remote_addr;
  46.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47.         proxy_set_header REMOTE-HOST $remote_addr;
  48.     }
  49.    
  50.     location /
  51.     {
  52.         proxy_pass https://api.github.com;
  53.         proxy_set_header Host api.github.com;
  54.         proxy_set_header X-Real-IP $remote_addr;
  55.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  56.         proxy_set_header REMOTE-HOST $remote_addr;
  57.         add_header X-Cache $upstream_cache_status;
  58.         proxy_ignore_headers Set-Cookie Cache-Control expires;
  59.         # proxy_cache cache_one;
  60.         proxy_cache_key $host$uri$is_args$args;
  61.         proxy_cache_valid 200 304 301 302 480m;
  62.         expires 12h;
  63.     }
  64.     #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
  65.     #error_page 404 /404.html;
  66.     #error_page 502 /502.html;
  67.     #ERROR-PAGE-END

  68.     #PHP-INFO-START  PHP引用配置,可以注释或修改
  69.    

  70.         include enable-php-00.conf;
  71.     #PHP-INFO-END

  72.     #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  73.     include /www/server/panel/vhost/rewrite/api.205b.com.conf;
  74.     #REWRITE-END

  75.     #禁止访问的文件或目录
  76.     location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
  77.     {
  78.         return 404;
  79.     }

  80.     #一键申请SSL证书验证目录相关设置
  81.     location ~ \.well-known{
  82.         allow all;
  83.     }

  84.     #禁止在证书验证目录放入敏感文件
  85.     if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
  86.         return 403;
  87.     }

  88.     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  89.     {
  90.         expires      30d;
  91.         error_log /dev/null;
  92.         access_log /dev/null;
  93.     }
  94.     location ~ .*\.(js|css)?$
  95.     {
  96.         expires      12h;
  97.         error_log /dev/null;
  98.         access_log /dev/null;
  99.     }
  100.         access_log  /www/wwwlogs/api.205b.com.log;
  101.     error_log  /www/wwwlogs/api.205b.com.error.log;
  102. }
复制代码

94

主题

36

回帖

849

积分

管理员

积分
849
 楼主| 发表于 2023-10-9 22:28:49 | 显示全部楼层
codeload.205bcom collector.github.com
  1. upstream collectorgithub {
  2.     server github.com:443;
  3.     keepalive 32;
  4. }
  5. server
  6. {
  7.     listen 80;
  8.                 listen 443 ssl http2;
  9.     server_name codeload.205bcom;
  10.     index index.php index.html index.htm default.php default.htm default.html;
  11.     root /www/wwwroot/codeload.205bcom;

  12.     #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
  13.     #error_page 404/404.html;
  14.     #HTTP_TO_HTTPS_START
  15.     if ($server_port !~ 443){
  16.         rewrite ^(/.*)$ https://$host$1 permanent;
  17.     }
  18.     #HTTP_TO_HTTPS_END
  19.     ssl_certificate    /www/server/panel/vhost/cert/codeload.205bcom/fullchain.pem;
  20.     ssl_certificate_key    /www/server/panel/vhost/cert/codeload.205bcom/privkey.pem;
  21.     ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  22.     ssl_ciphers EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+AES128:RSA+AES128:EECDH+AES256:RSA+AES256:EECDH+3DES:RSA+3DES:!MD5;
  23.     ssl_prefer_server_ciphers on;
  24.     ssl_session_cache shared:SSL:10m;
  25.     ssl_session_timeout 10m;
  26.     add_header Strict-Transport-Security "max-age=31536000";
  27.     error_page 497  https://$host$request_uri;

  28.     #SSL-END

  29.     error_page 497  https://$host$request_uri;

  30.     # SSL
  31.     location ~ \.well-known {
  32.         allow all;
  33.     }
  34.    
  35.     # Fuck Search Engine
  36.     location /robots.txt {
  37.         allow all;
  38.     }
  39.    
  40.     #PROXY-START/
  41.     location ~* \.(php|jsp|cgi|asp|aspx)$
  42.     {
  43.         proxy_pass https://collector.github.com;
  44.         proxy_set_header Host collector.github.com;
  45.         proxy_set_header X-Real-IP $remote_addr;
  46.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  47.         proxy_set_header REMOTE-HOST $remote_addr;
  48.     }
  49.    
  50.     location /
  51.     {
  52.         proxy_pass https://collector.github.com;
  53.         proxy_set_header Host collector.github.com;
  54.         proxy_set_header X-Real-IP $remote_addr;
  55.         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  56.         proxy_set_header REMOTE-HOST $remote_addr;
  57.         add_header X-Cache $upstream_cache_status;
  58.         proxy_ignore_headers Set-Cookie Cache-Control expires;
  59.         # proxy_cache cache_one;
  60.         proxy_cache_key $host$uri$is_args$args;
  61.         proxy_cache_valid 200 304 301 302 480m;
  62.         expires 12h;
  63.     }
  64.     #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
  65.     #error_page 404 /404.html;
  66.     #error_page 502 /502.html;
  67.     #ERROR-PAGE-END

  68.     #PHP-INFO-START  PHP引用配置,可以注释或修改
  69.     include enable-php-00.conf;
  70.     #PHP-INFO-END

  71.     #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
  72.     include /www/server/panel/vhost/rewrite/codeload.205bcom.conf;
  73.     #REWRITE-END

  74.     #禁止访问的文件或目录
  75.     location ~ ^/(\.user.ini|\.htaccess|\.git|\.env|\.svn|\.project|LICENSE|README.md)
  76.     {
  77.         return 404;
  78.     }

  79.     #一键申请SSL证书验证目录相关设置
  80.     location ~ \.well-known{
  81.         allow all;
  82.     }

  83.     #禁止在证书验证目录放入敏感文件
  84.     if ( $uri ~ "^/\.well-known/.*\.(php|jsp|py|js|css|lua|ts|go|zip|tar\.gz|rar|7z|sql|bak)$" ) {
  85.         return 403;
  86.     }

  87.     location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
  88.     {
  89.         expires      30d;
  90.         error_log /dev/null;
  91.         access_log /dev/null;
  92.     }

  93.     location ~ .*\.(js|css)?$
  94.     {
  95.         expires      12h;
  96.         error_log /dev/null;
  97.         access_log /dev/null;
  98.     }
  99.     access_log  /www/wwwlogs/codeload.205bcom.log;
  100.     error_log  /www/wwwlogs/codeload.205bcom.error.log;
  101. }
复制代码

94

主题

36

回帖

849

积分

管理员

积分
849
 楼主| 发表于 2023-10-9 22:30:42 | 显示全部楼层
        user-images.205b.com
user-images.githubusercontent.com  
直接宝塔反向代理
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表