nginx-profiles/edit.silvrtree.co.uk
2016-06-29 11:48:51 +01:00

48 lines
1.0 KiB
Plaintext

server {
listen [::]:80;
listen 80;
# listen on both hosts
server_name edit.silvrtree.co.uk;
# and redirect to the https host (declared below)
# avoiding http://www -> https://www -> https:// chain.
return 301 https://edit.silvrtree.co.uk$request_uri;
}
server {
listen [::]:443 ssl spdy;
listen 443 ssl spdy;
server_name edit.silvrtree.co.uk;
include secure/ssl.conf;
location / {
proxy_pass http://localhost:8200;
proxy_set_header Host $host;
}
location /couchdb/(.*)$ {
rewrite /couchdb/(.*) /$1 break;
proxy_pass http://127.0.0.1:5984;
proxy_pass_header Accept;
proxy_pass_header Server;
keepalive_requests 1000;
add_header 'Access-Control-Allow-Origin' '*';
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header Authorization ""; # or according to server.ini
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}