Skip to content
Snippets Groups Projects
Commit b844efca authored by Gallenkamp, Fabian's avatar Gallenkamp, Fabian
Browse files

added 403 option, if redirection not defined

parent f3b66c32
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
owner: root owner: root
group: root group: root
mode: "0644" mode: "0644"
notify: restart nginx
- name: create symlinks for nginx vhosts confs - name: create symlinks for nginx vhosts confs
file: file:
...@@ -61,6 +62,7 @@ ...@@ -61,6 +62,7 @@
group: root group: root
mode: "0644" mode: "0644"
with_dict: "{{ otree_users }}" with_dict: "{{ otree_users }}"
notify: restart nginx
- name: create symlinks for nginx vhosts confs - name: create symlinks for nginx vhosts confs
file: file:
...@@ -87,5 +89,5 @@ ...@@ -87,5 +89,5 @@
- name: restart nginx - name: restart nginx
service: service:
name: nginx name: nginx
state: restarted state: reloaded
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
chdir: "{{ home_path }}/{{ item.key }}/otree/" chdir: "{{ home_path }}/{{ item.key }}/otree/"
executable: /bin/bash executable: /bin/bash
environment: environment:
DATABASE_URL: "{{ item.value.database }}" DATABASE_URL: "postgres://{{ item.key }}:{{ item.value.admin_pw }}@localhost:5432/instance_{{ item.key }}"
REDIS_URL: "{{ item.value.redis }}" REDIS_URL: "{{ item.value.redis }}"
OTREE_ADMIN_PASSWORD: "{{ item.value.admin_pw }}" OTREE_ADMIN_PASSWORD: "{{ item.value.admin_pw }}"
OTREE_AUTH_LEVEL: "{{ item.value.auth_level }}" OTREE_AUTH_LEVEL: "{{ item.value.auth_level }}"
......
...@@ -21,7 +21,7 @@ server { ...@@ -21,7 +21,7 @@ server {
ssl_certificate_key {{ ssl_certificate_key_path }}; ssl_certificate_key {{ ssl_certificate_key_path }};
location / { location / {
return 301 {{ default_redirection }}; return {% if default_redirection is defined %}301 {{ default_redirection }}{% else %}403{% endif %};
} }
} }
[program:{{ item.key }}] [program:{{ item.key }}]
directory={{ home_path }}/{{ item.key }}/otree/ directory={{ home_path }}/{{ item.key }}/otree/
command=/bin/bash -c "source {{ home_path }}/{{ item.key }}/.venv_otree/bin/activate && otree runprodserver" command=/bin/bash -c "source {{ home_path }}/{{ item.key }}/.venv_otree/bin/activate && otree runprodserver"
environment=DATABASE_URL="{{ item.value.database }}",REDIS_URL="{{ item.value.redis }}",OTREE_ADMIN_PASSWORD="{{ item.value.admin_pw }}",OTREE_AUTH_LEVEL="{{ item.value.auth_level }}",OTREE_SECRET_KEY="{{ item.value.secret_key }}",OTREE_PRODUCTION="{{ item.value.production }}",PORT={{ item.value.port }} environment=DATABASE_URL="postgres://{{ item.key }}:{{ item.value.admin_pw }}@localhost:5432/instance_{{ item.key }}",REDIS_URL="{{ item.value.redis }}",OTREE_ADMIN_PASSWORD="{{ item.value.admin_pw }}",OTREE_AUTH_LEVEL="{{ item.value.auth_level }}",OTREE_SECRET_KEY="{{ item.value.secret_key }}",OTREE_PRODUCTION="{{ item.value.production }}",PORT={{ item.value.port }}
autostart=true autostart=true
autorestart=true autorestart=true
startretries=3 startretries=3
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment