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,7 +1,15 @@
location #LOCATION# { location = {PATH}/.well-known/carddav {
alias #DESTDIR#/html; return 301 https://$server_name{PATH}/card.php;
}
location = {PATH}/.well-known/caldav {
return 301 https://$server_name{PATH}/cal.php;
}
location {LOCATION} {
alias {DESTDIR}/html/;
if ($scheme = http) { if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent; return 301 https://$server_name$request_uri;
} }
index index.php; index index.php;
@ -13,15 +21,8 @@ location #LOCATION# {
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param SCRIPT_FILENAME $request_filename;
} }
}
location ~ ^#PATH#/(\.|Core|Specific) { location ~ ^{PATH}/(\.|Core|Specific) {
deny all; 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 # Copy and set nginx configuration
nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf" nginx_conf="/etc/nginx/conf.d/${domain}.d/${app}.conf"
sed -i "s@#PATH#@${path}@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@{LOCATION}@${path:-/}@g" ../conf/nginx.conf
sed -i "s@#DESTDIR#@${DESTDIR}@g" ../conf/nginx.conf sed -i "s@{DESTDIR}@${DESTDIR}@g" ../conf/nginx.conf
sudo cp ../conf/nginx.conf "$nginx_conf" sudo cp ../conf/nginx.conf "$nginx_conf"
# Save app settings # Save app settings

View file

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