mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-23 18:03:17 +00:00
ansible WIP
This commit is contained in:

committed by
Thibaud Fabre

parent
23fda9f81e
commit
0057cccdfe
3
resources/ansible/roles/nginx/handlers/main.yml
Normal file
3
resources/ansible/roles/nginx/handlers/main.yml
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
- name: restart nginx
|
||||
service: name=nginx enabled=yes state=restarted
|
9
resources/ansible/roles/nginx/tasks/main.yml
Normal file
9
resources/ansible/roles/nginx/tasks/main.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
- name: Install Nginx
|
||||
sudo: yes
|
||||
apt: pkg=nginx state=latest
|
||||
|
||||
- name: Change default nginx site
|
||||
sudo: yes
|
||||
template: src=default.j2 dest=/etc/nginx/sites-available/default
|
||||
notify: restart nginx
|
75
resources/ansible/roles/nginx/templates/default.j2
Normal file
75
resources/ansible/roles/nginx/templates/default.j2
Normal file
@@ -0,0 +1,75 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
root {{ nginx.docroot }};
|
||||
index index.html index.php;
|
||||
|
||||
server_name dev.{{ hostname }}.vb;
|
||||
|
||||
location @rewriteapp {
|
||||
root {{ nginx.docroot }}/www;
|
||||
index index.html index.htm index.php;
|
||||
rewrite ^(.*)$ /index_dev.php/$1 last;
|
||||
}
|
||||
|
||||
location / {
|
||||
root {{ nginx.docroot }}/www;
|
||||
try_files $uri $uri/ @rewriteapp;
|
||||
}
|
||||
|
||||
location /api {
|
||||
root {{ nginx.docroot }}/www;
|
||||
rewrite ^(.*)$ /api.php/$1 last;
|
||||
}
|
||||
|
||||
location ~ ^/(index|index_dev|api)\.php(/|$) {
|
||||
root {{ nginx.docroot }}/www;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH /usr/local/bin:/usr/bin:/bin;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
sendfile off;
|
||||
client_max_body_size 2g;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
root {{ nginx.docroot }};
|
||||
index index.html index.php;
|
||||
|
||||
server_name www.{{ hostname }}.vb;
|
||||
|
||||
location @rewriteapp {
|
||||
root {{ nginx.docroot }}/www;
|
||||
index index.html index.htm index.php;
|
||||
rewrite ^(.*)$ /index.php/$1 last;
|
||||
}
|
||||
|
||||
location / {
|
||||
root {{ nginx.docroot }}/www;
|
||||
try_files $uri $uri/ @rewriteapp;
|
||||
}
|
||||
|
||||
location /api {
|
||||
root {{ nginx.docroot }}/www;
|
||||
rewrite ^(.*)$ /api.php/$1 last;
|
||||
}
|
||||
|
||||
location ~ ^/(index|index_dev|api)\.php(/|$) {
|
||||
root {{ nginx.docroot }}/www;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH /usr/local/bin:/usr/bin:/bin;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
||||
sendfile off;
|
||||
client_max_body_size 2g;
|
||||
}
|
Reference in New Issue
Block a user