CodeForAfrica / sensors.AFRICA-api

The sensors.AFRICA API receiving, storing, and processing data received from sensors across the continentent. Accessible at https://api.sensors.africa/
https://api.sensors.africa/
18 stars 7 forks source link

Nginx Configuration #8

Closed karimkawambwa closed 5 years ago

karimkawambwa commented 5 years ago

Description

This is nginx configuration for the production server. It is similar to that used in sensors.AFRICA-AQ-api.

Type of change

Please delete options that are not relevant.

Checklist:

DavidLemayian commented 5 years ago

What does it do outside of template? - https://github.com/dokku/dokku/blob/master/plugins/nginx-vhosts/templates/nginx.conf.sigil

karimkawambwa commented 5 years ago

@DavidLemayian the biggest difference is this:

{{ if (and (eq $listen_port "80") ($.SSL_INUSE)) }}
  return 301 https://$host:{{ $.PROXY_SSL_PORT }}$request_uri;
{{ else }}

The dokku template has a redirect if we have ssl enabled which will not work with our current sensors. I started skimming through the https://github.com/CodeForAfricaLabs/sensors.AFRICA-AQ-sensors-software and from initial observations I noticed that its using http protocols. There is a hints of using WiFiClientSecure however there is an if statement which from the looks of it will never be true.

kilemensi commented 5 years ago

This one also needs updating @karimkawambwa.

karimkawambwa commented 5 years ago

@kilemensi 👀