Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
configure an Nginx proxy for cortex.status.im
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Sokołowski <[email protected]>
  • Loading branch information
jakubgs committed Oct 13, 2020
1 parent ca0936b commit 9ef85ce
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
34 changes: 28 additions & 6 deletions ansible/group_vars/thehive-master.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
# Cortex -----------------------------------------------------------------------

# Ports
cortex_domain: 'cortex.status.im'
cortex_port: 9001

# Paths
Expand All @@ -20,11 +19,7 @@ cortex_search_nodes: |
| list }}
# The Hive ---------------------------------------------------------------------

# The Hive UI
the_hive_domain: 'hive.status.im'

# Ports
the_hive_port: 9000

# TheHive application secret
Expand Down Expand Up @@ -88,3 +83,30 @@ nginx_sites:
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}

cortex_http:
- listen 80
- server_name {{ cortex_domain }}
- return 302 https://$server_name$request_uri

cortex_https:
- listen 443 ssl
- server_name {{ cortex_domain }}

- ssl_certificate /certs/status.im/origin.crt
- ssl_certificate_key /certs/status.im/origin.key

- location / {
proxy_pass http://127.0.0.1:{{ cortex_port }}/;
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_read_timeout 3600;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
9 changes: 9 additions & 0 deletions dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@ resource "cloudflare_record" "hive_ui" {
proxied = true
}

resource "cloudflare_record" "cortex_ui" {
zone_id = lookup(local.zones, "status.im")
type = "A"
name = "cortex"
value = module.hive_master.public_ips[count.index]
count = length(module.hive_master.public_ips)
proxied = true
}

resource "cloudflare_record" "hive_es_hq" {
zone_id = lookup(local.zones, "status.im")
type = "A"
Expand Down

0 comments on commit 9ef85ce

Please sign in to comment.