Created
July 11, 2011 18:22
-
-
Save jimklo/1076436 to your computer and use it in GitHub Desktop.
CouchDB _utils redirecting to port 80
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
jklo$ curl -i -X GET "http://ec2-174-129-59-231.compute-1.amazonaws.com:5984/_utils" | |
HTTP/1.1 301 Moved Permanently | |
Server: nginx/0.7.65 | |
Date: Mon, 11 Jul 2011 18:20:59 GMT | |
Connection: keep-alive | |
Location: http://ec2-174-129-59-231.compute-1.amazonaws.com/_utils/ | |
Content-Length: 0 |
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
# statements for each of your virtual hosts | |
server { | |
listen 80 default; | |
server_name localhost; | |
access_log /var/log/nginx/learningregistry.access.log; | |
location / { | |
fastcgi_pass 127.0.0.1:5000; | |
fastcgi_param PATH_INFO $fastcgi_script_name; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param CONTENT_TYPE $content_type; | |
fastcgi_param CONTENT_LENGTH $content_length; | |
fastcgi_param SERVER_ADDR $server_addr; | |
fastcgi_param SERVER_PORT $server_port; | |
fastcgi_param SERVER_NAME $server_name; | |
fastcgi_param SERVER_PROTOCOL $server_protocol; | |
fastcgi_pass_header Authorization; | |
fastcgi_intercept_errors off; | |
} | |
#error_page 404 /404.html; | |
# redirect server error pages to the static page /50x.html | |
# | |
error_page 500 502 503 504 /50x.html; | |
location = /50x.html { | |
root html; | |
} | |
# proxy the PHP scripts to Apache listening on 127.0.0.1:80 | |
# | |
#location ~ \.php$ { | |
#proxy_pass http://127.0.0.1; | |
#} | |
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 | |
# | |
#location ~ \.php$ { | |
#fastcgi_pass 127.0.0.1:9000; | |
#fastcgi_index index.php; | |
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; | |
#includefastcgi_params; | |
#} | |
# deny access to .htaccess files, if Apache's document root | |
# concurs with nginx's one | |
# | |
#location ~ /\.ht { | |
#deny all; | |
#} | |
} | |
server { | |
listen domU-12-31-39-04-41-E2.compute-1.internal:5984; | |
server_name domU-12-31-39-04-41-E2; | |
location / { | |
# limit_except GET { | |
# deny all; | |
# } | |
# auth_basic "CouchDB Admin"; | |
# auth_basic_user_file /etc/nginx/passwd; | |
# proxy_set_header Authorization ""; | |
proxy_pass http://127.0.0.1:5984; | |
proxy_redirect off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
location ~ ^/(.*)/_changes { | |
proxy_pass http://127.0.0.1:5984; | |
proxy_redirect off; | |
proxy_buffering off; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} |
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
user www-data; | |
worker_processes 1; | |
error_log /var/log/nginx/error.log; | |
pid /var/run/nginx.pid; | |
events { | |
worker_connections 1024; | |
# multi_accept on; | |
} | |
http { | |
include /etc/nginx/mime.types; | |
access_log /var/log/nginx/access.log; | |
sendfile on; | |
#tcp_nopush on; | |
#keepalive_timeout 0; | |
keepalive_timeout 65; | |
tcp_nodelay on; | |
gzip on; | |
gzip_disable "MSIE [1-6]\.(?!.*SV1)"; | |
include /etc/nginx/conf.d/*.conf; | |
include /etc/nginx/sites-enabled/*; | |
} | |
# mail { | |
# # See sample authentication script at: | |
# # http://wiki.nginx.org/NginxImapAuthenticateWithApachePhpScript | |
# | |
# # auth_http localhost/auth.php; | |
# # pop3_capabilities "TOP" "USER"; | |
# # imap_capabilities "IMAP4rev1" "UIDPLUS"; | |
# | |
# server { | |
# listen localhost:110; | |
# protocol pop3; | |
# proxy on; | |
# } | |
# | |
# server { | |
# listen localhost:143; | |
# protocol imap; | |
# proxy on; | |
# } | |
# } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment