94 lines
2.6 KiB
Plaintext
94 lines
2.6 KiB
Plaintext
# /etc/nginx/base_http.conf
|
|
|
|
# zero copy within the kernel
|
|
sendfile on;
|
|
|
|
# send packets only if filled
|
|
tcp_nopush on;
|
|
|
|
# remove 200ms delay
|
|
tcp_nodelay on;
|
|
|
|
# load mime types and set default one
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
# access log format
|
|
log_format logf '{{ LOG_FORMAT }}';
|
|
access_log /var/log/nginx/access.log logf;
|
|
|
|
# temp paths
|
|
proxy_temp_path /opt/bunkerweb/tmp/proxy_temp;
|
|
client_body_temp_path /opt/bunkerweb/tmp/client_temp;
|
|
fastcgi_temp_path /opt/bunkerweb/tmp/fastcgi_temp;
|
|
uwsgi_temp_path /opt/bunkerweb/tmp/uwsgi_temp;
|
|
scgi_temp_path /opt/bunkerweb/tmp/scgi_temp;
|
|
|
|
# close connections in FIN_WAIT1 state
|
|
reset_timedout_connection on;
|
|
|
|
# timeouts
|
|
client_body_timeout 10;
|
|
client_header_timeout 10;
|
|
keepalive_timeout 15;
|
|
send_timeout 10;
|
|
|
|
# resolvers to use
|
|
resolver {{ DNS_RESOLVERS }} ipv6=off;
|
|
|
|
# remove ports when sending redirects
|
|
port_in_redirect off;
|
|
|
|
# lua path and dicts
|
|
lua_package_path "/opt/bunkerweb/lua/?.lua;/opt/bunkerweb/core/?.lua;/opt/bunkerweb/plugins/?.lua;/opt/bunkerweb/deps/lib/lua/?.lua;;";
|
|
lua_package_cpath "/opt/bunkerweb/deps/lib/?.so;/opt/bunkerweb/deps/lib/lua/?.so;;";
|
|
lua_ssl_trusted_certificate "/opt/bunkerweb/misc/root-ca.pem";
|
|
lua_ssl_verify_depth 2;
|
|
lua_shared_dict datastore {{ DATASTORE_MEMORY_SIZE }};
|
|
|
|
# LUA init block
|
|
include /etc/nginx/init-lua.conf;
|
|
|
|
# API server
|
|
{% if USE_API == "yes" %}include /etc/nginx/api.conf;{% endif +%}
|
|
|
|
# healthcheck server
|
|
include /etc/nginx/healthcheck.conf;
|
|
|
|
# default server
|
|
{% if MULTISITE == "yes" or DISABLE_DEFAULT_SERVER == "yes" +%}
|
|
include /etc/nginx/default-server-http.conf;
|
|
{% endif +%}
|
|
|
|
# disable sending nginx version globally
|
|
server_tokens off;
|
|
|
|
# server config(s)
|
|
{% if TEMP_NGINX != "yes" +%}
|
|
{% if MULTISITE == "yes" and SERVER_NAME != "" %}
|
|
{% set map_servers = {} %}
|
|
{% for server_name in SERVER_NAME.split(" ") %}
|
|
{% if server_name + "_SERVER_NAME" in all %}
|
|
{% set x = map_servers.update({server_name : all[server_name + "_SERVER_NAME"].split(" ")}) %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% for server_name in SERVER_NAME.split(" ") %}
|
|
{% if not server_name in map_servers %}
|
|
{% set found = {"res": false} %}
|
|
{% for first_server, servers in map_servers.items() %}
|
|
{% if server_name in servers %}
|
|
{% set x = found.update({"res" : true}) %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% if not found["res"] %}
|
|
{% set x = map_servers.update({server_name : [server_name]}) %}
|
|
{% endif %}
|
|
{% endif %}
|
|
{% endfor %}
|
|
{% for first_server in map_servers +%}
|
|
include /etc/nginx/{{ first_server }}/server.conf;
|
|
{% endfor %}
|
|
{% elif MULTISITE == "no" and SERVER_NAME != "" +%}
|
|
include /etc/nginx/server.conf;
|
|
{% endif %}
|
|
{% endif %} |