Git initial commit
This commit is contained in:
commit
d530a919d6
12 files changed
+473
No files matched your search
Executable
+96
@@ -0,0 +1,96 @@
|
||||
user {{ www_group }};
|
||||
worker_processes auto;
|
||||
pid {{ nginx_pid }};
|
||||
include /etc/nginx/modules-enabled/*.conf;
|
||||
|
||||
events {
|
||||
worker_connections {{ nginx_worker_count }};
|
||||
# multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
|
||||
##
|
||||
# Basic Settings
|
||||
##
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 2048;
|
||||
# server_tokens off;
|
||||
|
||||
# server_names_hash_bucket_size 64;
|
||||
# server_name_in_redirect off;
|
||||
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
##
|
||||
# SSL Settings
|
||||
##
|
||||
|
||||
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
|
||||
ssl_prefer_server_ciphers on;
|
||||
|
||||
##
|
||||
# Logging Settings
|
||||
##
|
||||
|
||||
access_log {{ nginx_log_path }}/access.log;
|
||||
error_log {{ nginx_log_path }}/error.log;
|
||||
|
||||
##
|
||||
# Gzip Settings
|
||||
##
|
||||
|
||||
gzip {{ 'on' if nginx_gzip else 'off' }};
|
||||
|
||||
# gzip_vary on;
|
||||
# gzip_proxied any;
|
||||
# gzip_comp_level 6;
|
||||
# gzip_buffers 16 8k;
|
||||
# gzip_http_version 1.1;
|
||||
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
||||
|
||||
##
|
||||
# Virtual Host Configs
|
||||
##
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
|
||||
### Ansible included configs ###
|
||||
{% for http_conf in nginx_conf_http %}
|
||||
{{ http_conf | indent(width=4, indentfirst=False) }}
|
||||
{% endfor %}
|
||||
}
|
||||
#mail {
|
||||
# # See sample authentication script at:
|
||||
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
|
||||
#
|
||||
# # auth_http localhost/auth.php;
|
||||
# # pop3_capabilities "TOP" "USER";
|
||||
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
|
||||
#
|
||||
# server {
|
||||
# listen localhost:110;
|
||||
# protocol pop3;
|
||||
# proxy on;
|
||||
# }
|
||||
#
|
||||
# server {
|
||||
# listen localhost:143;
|
||||
# protocol imap;
|
||||
# proxy on;
|
||||
# }
|
||||
#}
|
||||
|
||||
stream {
|
||||
include /etc/nginx/streams-enabled/*;
|
||||
}
|
||||
|
||||
{% for conf in nginx_conf %}
|
||||
{{ conf }}
|
||||
{% endfor %}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
{% if website.pre_options is defined %}
|
||||
{{ website.pre_options }}
|
||||
{% endif %}
|
||||
server {
|
||||
{% if website.domain is iterable and (website.domain is not mapping and website.domain is not string) %}
|
||||
server_name {{ website.domain | join(' ') }};
|
||||
|
||||
{% else %}
|
||||
server_name {{ website.domain }};
|
||||
{% endif %}
|
||||
{% if website.root is not defined %}
|
||||
root {{ www_root }}/{{ website.domain }}/{{ website.subroot | default('') }};
|
||||
{% elif website.root != 'noroot' %}
|
||||
root {{ website.root }};
|
||||
{% endif %}
|
||||
{% if website.index is not defined %}
|
||||
index index.html index.php index.htm;
|
||||
{% elif website.index != 'noindex' %}
|
||||
index {{ website.index | join(' ') }};
|
||||
{% endif %}
|
||||
|
||||
{% if website.options is defined %}
|
||||
{% for key in website.options.keys() %}
|
||||
{{ key }} {{ website.options[key] }};
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if website.add_header is defined %}
|
||||
{% for header in website.add_header %}
|
||||
add_header {{ header }};
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% for www_location in website.locations | default(default_locations) %}
|
||||
location {{ www_location.location | default('/') }} {
|
||||
{{ www_location.options | default('try_files $uri $uri/ =404;') | indent(width=16, first=False) }}
|
||||
}
|
||||
{% endfor %}
|
||||
|
||||
listen {% if use_ssl is defined and use_ssl %}443 ssl{% else %}{{ website.port | default(80) }}{% endif %}{% if website.port_option is defined and website.port_option != '' %}{{ website.port_option }}{% endif %};
|
||||
listen [::]:{% if use_ssl is defined and use_ssl %}443 ssl{% else %}{{ website.port | default(80) }}{% endif %}{% if website.port_option is defined and website.port_option != '' %}{{ website.port_option }}{% endif %};
|
||||
{% if use_ssl is defined and use_ssl %}
|
||||
ssl_certificate /etc/letsencrypt/live/{% if website.domain is not string and website.domain is iterable %}{{ website.domain[0] }}{% else %}{{ website.domain }}{% endif %}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{% if website.domain is not string and website.domain is iterable %}{{ website.domain[0] }}{% else %}{{ website.domain }}{% endif %}/privkey.pem;
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
{% endif %}
|
||||
}
|
||||
{% if use_ssl is defined and use_ssl %}
|
||||
server {
|
||||
{% if website.domain is iterable and website.domain is not string %}
|
||||
{% for domain in website.domain %}
|
||||
if ($host = {{ domain }}) {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
if ($host = {{ website.domain }}) {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
{% endif %}
|
||||
listen {{ website.port | default(80) }};
|
||||
listen [::]:{{ website.port | default(80) }};
|
||||
{% if website.domain is iterable and (website.domain is not mapping and website.domain is not string) %}
|
||||
server_name {{ website.domain | join(' ') }};
|
||||
{% else %}
|
||||
server_name {{ website.domain }};
|
||||
{% endif %}
|
||||
return 404;
|
||||
}
|
||||
{% endif %}
|
||||
{% if website.post_options is defined %}
|
||||
{{ website.post_options }}
|
||||
{% endif %}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
{% if stream.pre_options is defined %}
|
||||
{{ stream.pre_options }}
|
||||
{% endif %}
|
||||
server {
|
||||
listen {{ stream.port | default(8080) }} {% if use_ssl is defined and use_ssl %}ssl{% endif %}{% if stream.port_option is defined and stream.port_option != '' %}{{ stream.port_option }}{% endif %};
|
||||
listen [::]:{{ stream.port | default(8080) }} {% if use_ssl is defined and use_ssl %}ssl{% endif %}{% if stream.port_option is defined and stream.port_option != '' %}{{ stream.port_option }}{% endif %};
|
||||
|
||||
{% if stream.options is defined %}
|
||||
{% for key in stream.options.keys() %}
|
||||
{{ key }} {{ stream.options[key] }};
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
{% if use_ssl is defined and use_ssl %}
|
||||
ssl_certificate /etc/letsencrypt/live/{% if stream.domain is not string and stream.domain is iterable %}{{ stream.domain[0] }}{% else %}{{ stream.domain }}{% endif %}/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/{% if stream.domain is not string and stream.domain is iterable %}{{ stream.domain[0] }}{% else %}{{ stream.domain }}{% endif %}/privkey.pem;
|
||||
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;
|
||||
{% endif %}
|
||||
}
|
||||
Reference in new issue
Block a user