This is to avoid timeouts when gunicorn workers are busy.
Signed-off-by: Zack Cerza <zack@redhat.com>
paddles_repo: https://github.com/ceph/paddles.git
-# Default is to listen on all interfaces
-listen_ip: "0.0.0.0"
paddles_port: 8080
log_host: localhost
# Configure the system to run paddles as a daemon
- include: setup_service.yml
+
+# Configure nginx as a reverse proxy
+- include: nginx.yml
--- /dev/null
+---
+- name: Disable default nginx config
+ file:
+ name: /etc/nginx/sites-enabled/default
+ state: absent
+
+- name: Ship nginx config
+ template:
+ src: nginx.conf
+ dest: /etc/nginx/sites-available/paddles
+
+- name: Enable nginx config
+ file:
+ src: /etc/nginx/sites-available/paddles
+ dest: /etc/nginx/sites-enabled/paddles
+ state: link
+
+- name: Disable apache httpd
+ service:
+ name: "{{ apache_service }}"
+ enabled: no
+ state: stopped
+
+- name: Enable nginx
+ service:
+ name: nginx
+ enabled: yes
+ state: reloaded
+ changed_when: false
--- /dev/null
+server {
+ server_name {{ inventory_hostname }};
+ listen {{ ansible_all_ipv4_addresses[0] }}:{{ paddles_port }};
+ proxy_send_timeout 600;
+ proxy_connect_timeout 240;
+ location / {
+ proxy_pass http://127.0.0.1:{{ paddles_port }}/;
+ proxy_set_header Host $host;
+ proxy_set_header X-Real-IP $remote_addr;
+ }
+
+}
from paddles.hooks.cors import CorsHook
server = {
- 'port': '{{ paddles_port }}',
- 'host': '{{ listen_ip }}'
+ 'port': '8080',
+ 'host': '127.0.0.1'
}
address = '{{ paddles_address }}'
- postgresql-contrib
- postgresql-server-dev-all
- supervisor
+ # We use nginx to reverse-proxy
+ - nginx
+
+# We need this so we can disable apache2 to get out of the way of nginx
+apache_service: 'apache2'
supervisor_conf_d: /etc/supervisor/conf.d
supervisor_conf_suffix: conf