etc-configs/nginx/conf.d/dav.zzls.xyz.conf

47 lines
980 B
Text
Raw Normal View History

2024-01-10 00:40:02 -03:00
server {
access_log /var/log/nginx/dav.access.log;
error_log /var/log/nginx/dav.error.log;
2024-01-10 01:04:45 -03:00
server_name dav.zzls.xyz dav.nadeko.net;
2024-01-10 00:40:02 -03:00
root /opt/baikal/html;
2024-01-14 04:03:37 -03:00
index index.php;
2024-01-10 00:40:02 -03:00
include configs/general.conf;
2024-01-14 04:03:37 -03:00
include configs/security.conf;
2024-01-10 00:40:02 -03:00
rewrite ^/.well-known/caldav /dav redirect;
rewrite ^/.well-known/carddav /dav redirect;
charset utf-8;
location ~ /(\.ht|Core|Specific|config) {
deny all;
return 404;
}
location ~ ^(.+\.php)(.*)$ {
try_files $fastcgi_script_name =404;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(.*)$;
2024-01-14 04:03:37 -03:00
fastcgi_pass php-fpm;
2024-01-10 00:40:02 -03:00
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
listen 443 ssl;
http2 on;
}
server {
2024-01-10 01:04:45 -03:00
set $x "";
2024-01-14 04:03:37 -03:00
if ($host = dav.zzls.xyz) {
2024-01-10 01:04:45 -03:00
set $x 1;
}
2024-01-14 04:03:37 -03:00
if ($host = dav.nadeko.net) {
2024-01-10 01:04:45 -03:00
set $x 1;
}
if ($x = 1) {
2024-01-10 00:40:02 -03:00
return 301 https://$host$request_uri;
}
listen 80;
2024-01-10 01:04:45 -03:00
server_name dav.zzls.xyz dav.nadeko.net;
2024-01-10 00:40:02 -03:00
}