Created
October 20, 2011 13:32
-
-
Save taiyoh/1301147 to your computer and use it in GitHub Desktop.
nginxを使ったreproxyの最小(に近い)設定
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
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; | |
} | |
} | |
} |
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
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