Created
May 25, 2011 04:50
-
-
Save hotchpotch/990354 to your computer and use it in GitHub Desktop.
cocproxy for nginx
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
#!nginx -p . -c cocproxy.nginx.conf | |
error_log /dev/stderr debug; | |
daemon off; | |
events { | |
worker_connections 48; | |
} | |
http { | |
# include /etc/nginx/mime.types; | |
types { | |
application/x-javascript js; | |
application/x-shockwave-flash swf; | |
application/xhtml+xml xhtml; | |
image/gif gif; | |
image/jpeg jpeg jpg; | |
image/png png; | |
image/svg+xml svg; | |
image/tiff tif tiff; | |
image/x-icon ico; | |
text/css css; | |
text/html html htm shtml; | |
text/plain txt; | |
text/x-component htc; | |
text/xml xml; | |
} | |
default_type application/octet-stream; | |
server { | |
listen 127.0.0.1:8087; | |
resolver 8.8.8.8; | |
root ''; | |
access_log /dev/stdout; | |
location / { | |
if (-f $host/$request_filename) { | |
rewrite ^ $host/$request_filename last; | |
break; | |
} | |
if (-f $request_filename) { | |
rewrite ^ $request_filename last; | |
break; | |
} | |
proxy_pass http://$host$request_uri; | |
proxy_set_header Host $host; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment