1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/baikal_ynh.git synced 2024-09-03 18:16:11 +02:00

[fix] Prefix the installation path to .well-known in nginx.conf

This commit is contained in:
Jérôme Lebleu 2016-05-15 23:46:33 +02:00
parent f91f76af2b
commit 46e9ceba15
3 changed files with 30 additions and 29 deletions

View file

@ -1,27 +1,28 @@
location #LOCATION# {
alias #DESTDIR#/html;
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
index index.php;
location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
location = {PATH}/.well-known/carddav {
return 301 https://$server_name{PATH}/card.php;
}
location = {PATH}/.well-known/caldav {
return 301 https://$server_name{PATH}/cal.php;
}
location ~ ^#PATH#/(\.|Core|Specific) {
location {LOCATION} {
alias {DESTDIR}/html/;
if ($scheme = http) {
return 301 https://$server_name$request_uri;
}
index index.php;
location ~ ^(.+\.php)(.*)$ {
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
location ~ ^{PATH}/(\.|Core|Specific) {
deny all;
}
location /.well-known/carddav {
rewrite ^(.*)$ #PATH#/card.php redirect;
}
location /.well-known/caldav {
rewrite ^(.*)$ #PATH#/cal.php redirect;
}
}

View file

@ -64,9 +64,9 @@ sudo chown -R www-data: "$DESTDIR"
# Copy and set nginx configuration
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf"
sed -i "s@#PATH#@${path}@g" ../conf/nginx.conf
sed -i "s@#LOCATION#@${path:-/}@g" ../conf/nginx.conf
sed -i "s@#DESTDIR#@${DESTDIR}@g" ../conf/nginx.conf
sed -i "s@{PATH}@${path}@g" ../conf/nginx.conf
sed -i "s@{LOCATION}@${path:-/}@g" ../conf/nginx.conf
sed -i "s@{DESTDIR}@${DESTDIR}@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf "$nginx_conf"
# Save app settings

View file

@ -45,9 +45,9 @@ sudo chown -R www-data: "$DESTDIR"
# Copy and set nginx configuration
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf"
sed -i "s@#PATH#@${path}@g" ../conf/nginx.conf
sed -i "s@#LOCATION#@${path:-/}@g" ../conf/nginx.conf
sed -i "s@#DESTDIR#@${DESTDIR}@g" ../conf/nginx.conf
sed -i "s@{PATH}@${path}@g" ../conf/nginx.conf
sed -i "s@{LOCATION}@${path:-/}@g" ../conf/nginx.conf
sed -i "s@{DESTDIR}@${DESTDIR}@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf "$nginx_conf"
# Set SSOwat rules