diff --git a/roles/taiga/files/default.nginx b/roles/taiga/files/default.nginx new file mode 100644 index 0000000000..1751bf83c9 --- /dev/null +++ b/roles/taiga/files/default.nginx @@ -0,0 +1,5 @@ +large_client_header_buffers 4 32k; +client_max_body_size 50M; +charset utf-8; + +return 302 https://{{ inventory_hostname }}$request_uri; diff --git a/roles/taiga/files/taiga.nginx b/roles/taiga/files/taiga.nginx deleted file mode 100644 index 68db6d8b19..0000000000 --- a/roles/taiga/files/taiga.nginx +++ /dev/null @@ -1,51 +0,0 @@ -server { -# listen 80 default_server; -# server_name _; - - large_client_header_buffers 4 32k; - client_max_body_size 50M; - charset utf-8; - - # Langdon wanted his project renamed... so we redirect. - rewrite ^/project/langdon-modularity/(.*)$ /project/modularity/$1 redirect; - - # Frontend - location / { - root /home/taiga/taiga-front-dist/dist/; - try_files $uri $uri/ /index.html; - - disable_symlinks off; - } - - # Backend - location /api { - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Scheme $scheme; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_pass http://127.0.0.1:8001/api; - proxy_redirect off; - } - - # Django admin access (/admin/) - location /admin { - proxy_set_header Host $http_host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Scheme $scheme; - proxy_set_header X-Forwarded-Proto $scheme; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_pass http://127.0.0.1:8001$request_uri; - proxy_redirect off; - } - - # Static files - location /static { - alias /home/taiga/taiga-back/static; - } - - # Media files - location /media { - alias /home/taiga/taiga-back/media; - } -} diff --git a/roles/taiga/tasks/main.yml b/roles/taiga/tasks/main.yml index 08f1007f26..42ef1a14ac 100644 --- a/roles/taiga/tasks/main.yml +++ b/roles/taiga/tasks/main.yml @@ -280,7 +280,7 @@ - cron ### FINALLY, nginx to serve/proxy it all -- template: src=taiga-http.nginx dest=/etc/nginx/conf.d/taiga-http.conf +- copy: src=default.nginx dest=/etc/nginx/default.d/taiga.conf mode=0644 owner=nginx group=nginx notify: restart nginx tags: diff --git a/roles/taiga/templates/taiga-http.nginx b/roles/taiga/templates/taiga-http.nginx deleted file mode 100644 index 15f27287ea..0000000000 --- a/roles/taiga/templates/taiga-http.nginx +++ /dev/null @@ -1,10 +0,0 @@ -server { - listen 80 default_server; - server_name _; - - large_client_header_buffers 4 32k; - client_max_body_size 50M; - charset utf-8; - - return 302 https://{{ inventory_hostname }}$request_uri; -}