Skip to content

Commit 08170e1

Browse files
committed
Deploy with Nginx and Gunicorn
1 parent 9de7b0c commit 08170e1

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

ansible/idr-02-services.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
## Search services
1010
- import_playbook: idr-elasticsearch.yml
1111
- import_playbook: idr-searchengine.yml
12-
12+
- import_playbook: idr-searchengine_nginx.yml
1313
## Restore searchengine data if existence
1414
- import_playbook: restore_searchengine_data.yml

ansible/idr-searchengine_nginx.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
- name: Deploying nginx for search engine
2+
hosts: "{{ idr_environment | default('idr') }}-searchengine-hosts"
3+
4+
tasks:
5+
- name: Include ome.nginx role
6+
ansible.builtin.include_role:
7+
name: ome.nginx
8+
9+
- name: write nginx config
10+
become: true
11+
ansible.builtin.template:
12+
dest: /etc/nginx/conf.d/searchengine.conf
13+
src: searchengine.conf.j2
14+
mode: 0644
15+
16+
- name: Restart nginx
17+
service:
18+
name: nginx
19+
state: restarted
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
server {
3+
listen 8080;
4+
5+
location /searchengine {
6+
7+
proxy_pass http://127.0.0.1:5577/searchengine;
8+
proxy_redirect http://127.0.0.1:5577/searchengine $scheme://$server_name;
9+
proxy_set_header Host $host/searchengine;
10+
}
11+
12+
location /send_file/ {
13+
internal;
14+
alias /{{ apps_folder }}/data_dump/; # real file storage
15+
}
16+
}

0 commit comments

Comments
 (0)