ansible-role-nginx/templates/nginx.conf.j2
Dmitriy Skopintsev df84780f02 Enable autoindex in http, server and location namespaces (#75)
* Added condition to use new autoindex variable

* Added condition to use new autoindex variable for separate virtual hosts

* Added global autoindex and autoindex for separate virutal hosts

* Added autoindex enabling for virtual host namespace

* Added autoindex enabling for virtual host namespace variable

* Added autoindex for testing puprposes

* Changed autoindex to false

* Added autoindex for virtual host

* Added autoindex ot readme file
2018-11-26 12:06:46 -07:00

51 lines
1.5 KiB
Django/Jinja

user {{ nginx_main_template.user }};
worker_processes {{ nginx_main_template.worker_processes }};
error_log /var/log/nginx/error.log {{ nginx_main_template.error_level }};
pid /var/run/nginx.pid;
events {
worker_connections {{ nginx_main_template.worker_connections }};
}
{% if nginx_main_template.http_enable %}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout {{ nginx_main_template.http_settings.keepalive_timeout }};
#gzip on;
{% if nginx_main_template.http_settings.cache %}
proxy_cache_path /tmp/cache keys_zone=one:10m;
{% endif %}
{% if nginx_main_template.http_settings.rate_limit %}
limit_req_zone $binary_remote_addr zone=mylimit:10m rate=10r/s;
{% endif %}
{% if nginx_main_template.http_settings.keyval %}
keyval_zone zone={{nginx_main_template.http_settings.keyval.zone}}:32k state=one.keyval;
keyval $arg_text $text zone=one;
{% endif %}
{% if nginx_main_template.http_global_autoindex %}
autoindex on;
{% endif %}
include /etc/nginx/conf.d/*.conf;
}
{% endif %}
{% if nginx_main_template.stream_enable %}
stream {
include /etc/nginx/conf.d/stream/*.conf;
}
{% endif %}