49 lines
1.2 KiB
Django/Jinja
49 lines
1.2 KiB
Django/Jinja
{% macro davina_core_common() %}
|
|
root {{var_davina_core_and_nginx_directory}};
|
|
index index.php;
|
|
|
|
location / {
|
|
try_files $uri $uri/ /index.php;
|
|
|
|
dav_methods PUT DELETE MKCOL COPY MOVE;
|
|
# dav_ext_methods PROPFIND PROPPATCH LOCK UNLOCK;
|
|
# dav_access user:rw group:rw all:r;
|
|
# create_full_put_path on;
|
|
}
|
|
|
|
location ~ \.php$ {
|
|
include fastcgi_params;
|
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
|
fastcgi_param REDIRECT_STATUS 200;
|
|
fastcgi_pass unix:/var/run/php/php8.4-fpm.sock;
|
|
}
|
|
{% endmacro %}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
|
|
server_name {{var_davina_core_and_nginx_domain}};
|
|
|
|
{% if var_davina_core_and_nginx_tls_mode == 'force' %}
|
|
return 301 https://$http_host$request_uri;
|
|
{% else %}
|
|
{{ davina_core_common() }}
|
|
{% endif %}
|
|
}
|
|
|
|
{% if var_davina_core_and_nginx_tls_mode != 'disable' %}
|
|
server {
|
|
listen 443 ssl;
|
|
listen [::]:443 ssl;
|
|
|
|
server_name {{var_davina_core_and_nginx_domain}};
|
|
|
|
ssl_certificate_key /etc/ssl/private/{{var_davina_core_and_nginx_domain}}.pem;
|
|
ssl_certificate /etc/ssl/fullchains/{{var_davina_core_and_nginx_domain}}.pem;
|
|
include /etc/nginx/ssl-hardening.conf;
|
|
|
|
{{ davina_core_common() }}
|
|
}
|
|
{% endif %}
|