Skip to content

Instantly share code, notes, and snippets.

@antonlukin
Last active August 25, 2020 10:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonlukin/9221342a3ef1acbe27c19d9f5ee33194 to your computer and use it in GitHub Desktop.
Save antonlukin/9221342a3ef1acbe27c19d9f5ee33194 to your computer and use it in GitHub Desktop.
location /facebook/ {
access_log off;
log_not_found off;
set $token "${args}&access_token=";
if ( $arg_id ~ "^https://knife.media/" ) {
set $args $token;
}
if ( $arg_id ~ "^https%3A%2F%2Fknife.media%2F" ) {
set $args $token;
}
resolver 1.1.1.1;
proxy_pass https://graph.facebook.com?$args;
proxy_ignore_headers Expires;
proxy_ignore_headers Cache-Control;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_cache facebook;
proxy_cache_valid any 30m;
proxy_cache_key $host$uri$is_args$arg_id;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment