Last active
August 25, 2020 10:14
-
-
Save antonlukin/9221342a3ef1acbe27c19d9f5ee33194 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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