Things needed:
- A domain that is tied to Cloudflare (free CF account is probably enough, depends on the load to your CDN)
- Make a Cloudflare R2 bucket > Take a note of its bucket name.
user nginx; | |
worker_processes 2; # Set this equal to the number of CPU cores | |
events { worker_connections 1024; } | |
http { | |
server_names_hash_bucket_size 64; | |
types_hash_max_size 2048; | |
server_tokens off; | |
include mime.types; | |
default_type application/octet-stream; | |
sendfile on; |
Things needed:
addEventListener('fetch', event => { | |
event.respondWith(handleRequest(event.request).catch((err) => { return new Response(err.message) })) | |
}) | |
const html = `<!DOCTYPE html> | |
<html> | |
<head> | |
<title>CF direct chain transfer</title> | |
</head> | |
<body> |
// 2023.4.23 更新,修复 gtag.js 加了个回车导致失效的问题 | |
// 2023.3.2 更新,修复上报到 region*.google-analytics.com 未被代理的问题 | |
addEventListener('fetch', (event) => { | |
// 这里可以加 filter | |
return event.respondWith(handleRequest(event)); | |
}); | |
// worker 应用的路由地址,末尾不加 '/' | |
const DOMAIN = 'https://example.workers.dev/routerpath'; |
// Version 1.4 | |
const DAY_IN_SECONDS = 60*60*24; | |
const BLACKLISTED_URL_PARAMS = [ | |
'fbclid', // Google Ads click Id | |
'gclid', // Facebook click Id | |
'msclkid', // Micorosft Ads Click Id | |
]; | |
addEventListener('fetch', event => { |
site:*/sign-in | |
site:*/account/login | |
site:*/forum/ucp.php?mode=login | |
inurl:memberlist.php?mode=viewprofile | |
intitle:"EdgeOS" intext:"Please login" | |
inurl:user_login.php | |
intitle:"Web Management Login" | |
site:*/users/login_form | |
site:*/access/unauthenticated | |
site:account.*.*/login |
site:*/sign-in | |
site:*/account/login | |
site:*/forum/ucp.php?mode=login | |
inurl:memberlist.php?mode=viewprofile | |
intitle:"EdgeOS" intext:"Please login" | |
inurl:user_login.php | |
intitle:"Web Management Login" | |
site:*/users/login_form | |
site:*/access/unauthenticated | |
site:account.*.*/login |
<?php | |
namespace App\Models; | |
use Illuminate\Database\Eloquent\Model; | |
class City extends Model | |
{ | |
/** | |
* @var array |
<?php | |
// This can be found in the Symfony\Component\HttpFoundation\Response class | |
const HTTP_CONTINUE = 100; | |
const HTTP_SWITCHING_PROTOCOLS = 101; | |
const HTTP_PROCESSING = 102; // RFC2518 | |
const HTTP_OK = 200; | |
const HTTP_CREATED = 201; | |
const HTTP_ACCEPTED = 202; |
# https://codex.wordpress.org/Nginx | |
# Global restrictions configuration file. | |
# Deleted config for .htaccess, robots.txt, favicon restriction | |
# because they are already included in the default | |
# domain.conf created by ispconfig | |
# Block PHP files in uploads, content, and includes directory. | |
location ~* /(?:uploads|files|wp-content|wp-includes)/.*\.php$ { | |
deny all; | |
} |