Skip to content

Instantly share code, notes, and snippets.

View staticfilestorage's full-sized avatar

staticfilestorage

View GitHub Profile
@staticfilestorage
staticfilestorage / gist:4f562537bd1ab4657666cdda8a957e98
Created October 21, 2019 04:30
用nginx搭建全能反向代理
最近有一些需求于是试着用nginx搭建一个全能的反向代理。
关键词是“全能”和“反向代理”,所以我们分开一个一个说。
反向代理
server {
listen 0.0.0.0:80;
listen [::]:80;
server_name yyy.zzz.xxx
location / {
@staticfilestorage
staticfilestorage / theme.xml
Created October 12, 2019 04:49 — forked from xivid/theme.xml
A Minimalist Blogger Theme
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html>
<html expr:dir='data:blog.languageDirection' xmlns='http://www.w3.org/1999/xhtml' xmlns:b='http://www.google.com/2005/gml/b' xmlns:data='http://www.google.com/2005/gml/data' xmlns:expr='http://www.google.com/2005/gml/expr'>
<head>
<meta charset='UTF-8'/>
<meta content='width=device-width' name='viewport'/>
<b:include data='blog' name='all-head-content'/>
<link href='//fonts.googleapis.com/css?family=Merriweather%3A300%2C400%2C700' media='all' rel='stylesheet' type='text/css'/>
<link href='//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css' rel='stylesheet'/>
server {
listen 80;
listen [::]:80;
server_name "~^(?<name>.*)\-douban\.ifttl\.com$";
valid_referers *.ifttl.com ifttl.com;
if ($invalid_referer) {
return 403;
}
location / {
proxy_pass https://$name.doubanio.com;
location /get/
{
set $hostx "";
set $addrs "";
if ( $uri ~ "^/get/http./+([^/]+)/(.+)$") {
set $hostx $1;
set $addrs $2;
}
resolver 127.0.0.1;
proxy_pass http://$hostx/$addrs;