Nginx API/Somethign proxy
example:
if you are working on a Wordpress website and need a quick and dirty way to mirror all the wp-content stuff
just add this to the original nginx site config file:
location /wp-content/uploads/ {
proxy_pass http://some-wordpress-site.com/wp-content/uploads/;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
and done
works as a Facebook API mirror:
location /fbapi/ {
proxy_pass http://graph.facebook.com;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
best of luck
Written by Costin Moise
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Proxy
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#