Initial commit
This commit is contained in:
commit
a4ac8e4ae8
2 changed files with 57 additions and 0 deletions
38
tasks/main.yml
Normal file
38
tasks/main.yml
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
---
|
||||
- ansible.builtin.blockinfile:
|
||||
path: /etc/nginx/nginx.conf
|
||||
block: |
|
||||
upstream storage_nemunaire {
|
||||
{% for server in s3_hosts %}
|
||||
server {{ server.host }}:{{ server.port | default(9000) }}{% if server.backup is defined and server.backup %} backup{% endif %};
|
||||
{% endfor %}
|
||||
}
|
||||
insertafter: 'http {'
|
||||
marker: "# {mark} ANSIBLE MANAGED BLOCK storage_nemunaire"
|
||||
|
||||
- ansible.builtin.set_fact:
|
||||
server: |
|
||||
location / {
|
||||
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 Host $http_host;
|
||||
proxy_connect_timeout 300;
|
||||
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
proxy_set_header Authorization "";
|
||||
proxy_intercept_errors on;
|
||||
chunked_transfer_encoding off;
|
||||
proxy_pass https://storage_nemunaire/{{ bucket }}{{ path }}/;
|
||||
|
||||
error_page 404 /err.html;
|
||||
#try_files $uri $uri/index.html $uri.html =404;
|
||||
}
|
||||
location ~ /$ {
|
||||
rewrite ^(.*)/ $1/index.html;
|
||||
}
|
||||
when: server is not defined
|
||||
|
||||
- ansible.builtin.include_role:
|
||||
name: re.nemunai.nginx-config-svc
|
||||
Loading…
Add table
Add a link
Reference in a new issue