mirror of
https://github.com/HanXHX/ansible-nginx.git
synced 2026-02-26 09:12:09 +07:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
95e2cb5f12 | ||
|
|
e4580676ce | ||
|
|
9da1673293 | ||
|
|
ed5b7bf2cf |
@@ -55,8 +55,10 @@ Socket:
|
||||
- `template`: (M) template used to create vhost
|
||||
- `enable`: (O) Enable the vhost (default is true)
|
||||
- `delete`: (O) Delete the vhost (default is false)
|
||||
- `redirect_from`: (O) Domain list to redirect to the first `name`. You can use this key to redirect non-www to www.
|
||||
- `location`: Add new custom locations (it does not overwrite!)
|
||||
- `redirect_from`: (O) Domain list to redirect to the first `name`. You can use this key to redirect non-www to www
|
||||
- `location`: (O) Add new custom locations (it does not overwrite!)
|
||||
- `more`: (O) Add more custom infos.
|
||||
- `upstream_params`: (O) Add upstream params (useful when you want to pass variables to PHP)
|
||||
|
||||
(O) : Optional
|
||||
(M) : Mandatory
|
||||
|
||||
@@ -22,6 +22,12 @@ server {
|
||||
index {{ item.index | default('index.html index.htm') }};
|
||||
{% endblock %}
|
||||
|
||||
{% if item.more is defined and item.more is iterable %}
|
||||
{% for line in item.more %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
location / {
|
||||
{% block template_try_files %}
|
||||
try_files $uri $uri/ =404;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{% extends "_php.j2" %}
|
||||
|
||||
{% block template_try_files %}
|
||||
try_files $uri $uri/ /index.php?_url=$uri;
|
||||
try_files $uri $uri/ /index.php?_url=$uri$is_args&$args;
|
||||
{% endblock %}
|
||||
|
||||
@@ -11,8 +11,11 @@
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php;
|
||||
fastcgi_index index.php;
|
||||
{# TODO: fastcgi_intercept_errors {{ item.php.intercept_errors | default('on') }}; #}
|
||||
fastcgi_intercept_errors on;
|
||||
{% if item.upstream_params is defined and item.upstream_params is iterable %}
|
||||
{% for param in item.upstream_params %}
|
||||
{{ param }}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% if nginx_version.stdout | version_compare('1.6.1', 'lt') %}
|
||||
include fastcgi_params;
|
||||
{% else %}
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
- 'test-alias.local'
|
||||
- 'test2-alias.local'
|
||||
template: '_base'
|
||||
more:
|
||||
- 'autoindex off;'
|
||||
location:
|
||||
'/test':
|
||||
- 'return 403;'
|
||||
@@ -21,6 +23,8 @@
|
||||
- 'return 404;'
|
||||
- name:
|
||||
- 'test-php.local'
|
||||
upstream_params:
|
||||
- 'fastcgi_param FOO bar;'
|
||||
redirect_from:
|
||||
- 'www.test-php.local'
|
||||
template: '_php'
|
||||
|
||||
Reference in New Issue
Block a user