helm: reorganize repository a bit.
[arvados-k8s.git] / charts / arvados / config / api-server / nginx.conf
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: Apache-2.0
4
5 server {
6   listen 127.0.0.1:8000;
7   server_name localhost-api;
8
9   root /var/www/arvados-api/current/public;
10   index  index.html index.htm index.php;
11
12   passenger_enabled on;
13   # If you're using RVM, uncomment the line below.
14   passenger_ruby /usr/local/rvm/wrappers/default/ruby;
15
16   # This value effectively limits the size of API objects users can
17   # create, especially collections.  If you change this, you should
18   # also ensure the following settings match it:
19   # * `client_max_body_size` in the server section below
20   # * `client_max_body_size` in the Workbench Nginx configuration (twice)
21   # * `max_request_size` in the API server's application.yml file
22   client_max_body_size 128m;
23 }
24
25 upstream api {
26   server     127.0.0.1:8000  fail_timeout=10s;
27 }
28
29 proxy_http_version 1.1;
30
31 # When Keep clients request a list of Keep services from the API server, the
32 # server will automatically return the list of available proxies if
33 # the request headers include X-External-Client: 1.  Following the example
34 # here, at the end of this section, add a line for each netmask that has
35 # direct access to Keep storage daemons to set this header value to 0.
36 geo $external_client {
37   default     1;
38   10.0.0.0/8  0;
39 }
40
41 server {
42   listen       0.0.0.0:444 ssl;
43   server_name  public-api;
44
45   ssl on;
46   ssl_certificate     /etc/ssl/certs/api-server.pem;
47   ssl_certificate_key /etc/ssl/private/api-server.key;
48
49   index  index.html index.htm index.php;
50
51   # Refer to the comment about this setting in the server section above.
52   client_max_body_size 128m;
53
54   location / {
55     proxy_pass            http://api;
56     proxy_redirect        off;
57     proxy_connect_timeout 90s;
58     proxy_read_timeout    300s;
59
60     proxy_set_header      X-Forwarded-Proto https;
61     proxy_set_header      Host $http_host;
62     proxy_set_header      X-External-Client $external_client;
63     proxy_set_header      X-Real-IP $remote_addr;
64     proxy_set_header      X-Forwarded-For $proxy_add_x_forwarded_for;
65   }
66 }