Skip to content

Instantly share code, notes, and snippets.

@taiyoh
Created October 20, 2011 13:32
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taiyoh/1301147 to your computer and use it in GitHub Desktop.
Save taiyoh/1301147 to your computer and use it in GitHub Desktop.
nginxを使ったreproxyの最小(に近い)設定
worker_processes 1;
error_log logs/error.log;
daemon off;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
server {
listen 8081;
server_name localhost;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:4567;
}
location /reploxy {
internal;
resolver 8.8.8.8;
set $reproxy $upstream_http_x_reproxy_url;
proxy_pass $reproxy;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
}
require 'sinatra'
get '/' do
response['X-Accel-Redirect'] = '/reploxy'
response['X-Reproxy-URL'] = 'http://www.sinatrarb.com/images/logo.gif'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment