hi! add your raw.githubusercontent.com link to the end of the url: https://rawgit.loltek.net/ example: to get: https://raw.githubusercontent.com/loltek/rawgit.loltek.net/master/src/www/script.php go to: https://rawgit.loltek.net/https://raw.githubusercontent.com/loltek/rawgit.loltek.net/master/src/www/script.php github repo (bugs/development/blahblah): https://github.com/loltek/rawgit.loltek.net nginx config for this script: server { listen 80; listen [::]:80; root /srv/http/rawgit.loltek.net/www; #autoindex on; index script.php; server_name rawgit.loltek.net; location / { #try_files $uri $uri/ =404; try_files $uri $uri/ /script.php$is_args$args; #try_files "" /script.php$is_args$args; } #error_page 404 =200 /script.php; # https://www.mediasuite.co.nz/blog/proxying-s3-downloads-nginx/ location ~ ^/githubusercontent_proxy/(.+) { internal; resolver 8.8.8.8 ipv6=off; set $proxy_url $1; proxy_set_header Host 'raw.githubusercontent.com'; proxy_set_header Accept-Encoding ''; proxy_set_header Authorization ''; proxy_set_header Cookie ''; proxy_hide_header 'Content-Type'; #proxy_hide_header 'Content-Disposition'; proxy_hide_header 'Connection'; proxy_hide_header 'content-security-policy'; #proxy_intercept_errors on; proxy_pass $proxy_url$is_args$args; } # pass PHP scripts to FastCGI server #location ~ \.php$ { # include snippets/fastcgi-php.conf; # index script.php; # fastcgi_param SCRIPT_FILENAME $document_root/script.php; # fastcgi_param SCRIPT_NAME /script.php; # fastcgi_index script.php; # fastcgi_pass unix:/run/php/php8.3-fpm.sock; #} # this clusterfuck seems to be needed to make it always redirect to script.php with proxying response code # if i use >>>try_files "" /script.php;<<< then it won't proxy github .php files, # if i use >>>try_files $uri $uri/ =404; error_page 404 /script.php<<< then it won't properly proxy github 304 Not Modified, always saying 404 instead of 200/304/etc # if i use >>>try_files $uri $uri/ =404; error_page 404 =200 /script.php<<< then it won't proxy 304 Not Modified/404, always saying HTTP 200 location ~ \.php$ { index script.php; #include snippets/fastcgi-php.conf; # # regex to split $uri to $fastcgi_script_name and $fastcgi_path fastcgi_split_path_info ^(.+?\.php)(/.*)$; #set $fastcgi_script_name "/script.php"; #return 200 "fastcgi_script_name: $fastcgi_script_name - fastcgi_path: $fastcgi_path"; #return 200 "fastcgi_script_name: $fastcgi_script_name - fastcgi_path: (borked)"; # Check that the PHP script exists before passing it #try_files $fastcgi_script_name =404; #try_files "" /script.php; # Bypass the fact that try_files resets $fastcgi_path_info # see: http://trac.nginx.org/nginx/ticket/321 set $path_info $fastcgi_path_info; fastcgi_param PATH_INFO $path_info; #return 200 "path_info: $path_info"; fastcgi_index script.php; #include fastcgi.conf; # ######fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root/script.php; #return 200 "SCRIPT_FILENAME: $document_root$fastcgi_script_name"; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; #######fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_NAME /script.php; #return 200 "fastcgi_script_name: $fastcgi_script_name"; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REQUEST_SCHEME $scheme; fastcgi_param HTTPS $https if_not_empty; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200; # # fastcgi_pass unix:/run/php/php8.3-fpm.sock; } listen [::]:443 ssl; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/ip.loltek.net/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/ip.loltek.net/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } source code for this script: 'text/html', 'htm' => 'text/html', 'shtml' => 'text/html', 'css' => 'text/css', 'xml' => 'text/xml', 'gif' => 'image/gif', 'jpeg' => 'image/jpeg', 'jpg' => 'image/jpeg', 'js' => 'application/javascript', 'atom' => 'application/atom+xml', 'rss' => 'application/rss+xml', 'mml' => 'text/mathml', 'txt' => 'text/plain', 'jad' => 'text/vnd.sun.j2me.app-descriptor', 'wml' => 'text/vnd.wap.wml', 'htc' => 'text/x-component', 'png' => 'image/png', 'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'wbmp' => 'image/vnd.wap.wbmp', 'ico' => 'image/x-icon', 'jng' => 'image/x-jng', 'bmp' => 'image/x-ms-bmp', 'svg' => 'image/svg+xml', 'svgz' => 'image/svg+xml', 'webp' => 'image/webp', 'woff' => 'application/font-woff', 'jar' => 'application/java-archive', 'war' => 'application/java-archive', 'ear' => 'application/java-archive', 'json' => 'application/json', 'hqx' => 'application/mac-binhex40', 'doc' => 'application/msword', 'pdf' => 'application/pdf', 'ps' => 'application/postscript', 'eps' => 'application/postscript', 'ai' => 'application/postscript', 'rtf' => 'application/rtf', 'm3u8' => 'application/vnd.apple.mpegurl', 'xls' => 'application/vnd.ms-excel', 'eot' => 'application/vnd.ms-fontobject', 'ppt' => 'application/vnd.ms-powerpoint', 'wmlc' => 'application/vnd.wap.wmlc', 'kml' => 'application/vnd.google-earth.kml+xml', 'kmz' => 'application/vnd.google-earth.kmz', '7z' => 'application/x-7z-compressed', 'cco' => 'application/x-cocoa', 'jardiff' => 'application/x-java-archive-diff', 'jnlp' => 'application/x-java-jnlp-file', 'run' => 'application/x-makeself', 'pl' => 'application/x-perl', 'pm' => 'application/x-perl', 'prc' => 'application/x-pilot', 'pdb' => 'application/x-pilot', 'rar' => 'application/x-rar-compressed', 'rpm' => 'application/x-redhat-package-manager', 'sea' => 'application/x-sea', 'swf' => 'application/x-shockwave-flash', 'sit' => 'application/x-stuffit', 'tcl' => 'application/x-tcl', 'tk' => 'application/x-tcl', 'der' => 'application/x-x509-ca-cert', 'pem' => 'application/x-x509-ca-cert', 'crt' => 'application/x-x509-ca-cert', 'xpi' => 'application/x-xpinstall', 'xhtml' => 'application/xhtml+xml', 'xspf' => 'application/xspf+xml', 'zip' => 'application/zip', 'bin' => 'application/octet-stream', 'exe' => 'application/octet-stream', 'dll' => 'application/octet-stream', 'deb' => 'application/octet-stream', 'dmg' => 'application/octet-stream', 'iso' => 'application/octet-stream', 'img' => 'application/octet-stream', 'msi' => 'application/octet-stream', 'msp' => 'application/octet-stream', 'msm' => 'application/octet-stream', 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', 'mid' => 'audio/midi', 'midi' => 'audio/midi', 'kar' => 'audio/midi', 'mp3' => 'audio/mpeg', 'ogg' => 'audio/ogg', 'm4a' => 'audio/x-m4a', 'ra' => 'audio/x-realaudio', '3gpp' => 'video/3gpp', '3gp' => 'video/3gpp', 'ts' => 'video/mp2t', 'mp4' => 'video/mp4', 'mpeg' => 'video/mpeg', 'mpg' => 'video/mpeg', 'mov' => 'video/quicktime', 'webm' => 'video/webm', 'flv' => 'video/x-flv', 'm4v' => 'video/x-m4v', 'mng' => 'video/x-mng', 'asx' => 'video/x-ms-asf', 'asf' => 'video/x-ms-asf', 'wmv' => 'video/x-ms-wmv', 'avi' => 'video/x-msvideo', ); if(isset($mimes[$lowercase_type])){ return $mimes[$lowercase_type]; } header("X-Unknown-Mime: true"); return 'application/octet-stream'; }