Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
cocproxy for nginx
#!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 {
root '';
access_log /dev/stdout;
location / {
if (-f $host/$request_filename) {
rewrite ^ $host/$request_filename last;
if (-f $request_filename) {
rewrite ^ $request_filename last;
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
You can’t perform that action at this time.