Merge branch '6918-remove-nginx-cors-headers' closes #6918
[arvados.git] / doc / install / install-keepproxy.html.textile.liquid
index f46e6500b5643b91092b63975f3665a651734a10..26addb7529cda609e398660b087fe29b8cefdb2d 100644 (file)
@@ -71,22 +71,33 @@ Because the Keepproxy is intended for access from anywhere on the internet, it i
 
 This is best achieved by putting a reverse proxy with SSL support in front of Keepproxy. Keepproxy itself runs on port 25107 by default; your reverse proxy can run on port 443 and pass requests to Keepproxy on port 25107.
 
-If possible, the proxy should be configured to add CORS headers to its own error responses -- otherwise in-browser applications can't report proxy errors. For example, in nginx >= 1.7.5:
-
 <notextile><pre>
+upstream keepproxy {
+  server                127.0.0.1:<span class="userinput">25107</span>;
+}
+
 server {
-  server_name keep.example.com
+  listen                <span class="userinput">[your public IP address]</span>:443 ssl;
+  server_name           keep.<span class="userinput">uuid_prefix</span>.your.domain
+
+  proxy_connect_timeout 90s;
+  proxy_read_timeout    300s;
+  proxy_set_header      X-Real-IP $remote_addr;
+
+  ssl                   on;
+  ssl_certificate       /etc/nginx/keep.example.com-ssl.crt;
+  ssl_certificate_key   /etc/nginx/keep.example.com-ssl.key;
+
   # Clients need to be able to upload blocks of data up to 64MiB in size.
-  client_max_body_size 70m;
-  ...
-  add_header 'Access-Control-Allow-Methods' 'GET, HEAD, POST, PUT, OPTIONS' always
-  add_header 'Access-Control-Allow-Origin' '*' always
-  add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Length, Content-Type, X-Keep-Desired-Replicas' always
-  add_header 'Access-Control-Max-Age' '86486400' always
+  client_max_body_size  64m;
+
+  location / {
+    proxy_pass          http://keepproxy;
+  }
 }
 </pre></notextile>
 
-*Warning:* Make sure you don't inadvertently add CORS headers for services _other than keepproxy_ while you're doing this.
+Note: if the Web uploader is failing to upload data and there are no logs from keepproxy, be sure to check the nginx proxy logs.  In addition to "GET" and "PUT", The nginx proxy must pass "OPTIONS" requests to keepproxy, which should respond with appropriate Cross-origin resource sharing headers.  If the CORS headers are not present, brower security policy will cause the upload request to silently fail.  The CORS headers are generated by keepproxy and should not be set in nginx.
 
 h3. Tell the API server about the Keepproxy server
 
@@ -104,4 +115,3 @@ The API server needs to be informed about the presence of your Keepproxy server.
 }
 EOF</span>
 </code></pre></notextile>
-