Fix an nginx conf typo

This commit is contained in:
Julien VAUBOURG
2014-12-28 23:28:09 +01:00
parent 2b1c541caa
commit 6fb227a250
2 changed files with 53 additions and 45 deletions

View File

@@ -174,15 +174,17 @@ moulinette_set() {
fi fi
} }
# Restart php5-fpm at the first start (it needs to be restarted after the slapd start) if [ "$1" != restart ]; then
if [ ! -e /tmp/.ynh-vpnclient-boot ]; then
# Restart php5-fpm at the first start (it needs to be restarted after the slapd start)
if [ ! -e /tmp/.ynh-vpnclient-boot ]; then
touch /tmp/.ynh-vpnclient-boot touch /tmp/.ynh-vpnclient-boot
service php5-fpm restart service php5-fpm restart
fi fi
# Check configuration consistency # Check configuration consistency
if [[ ! "${1}" =~ stop ]]; then if [[ ! "${1}" =~ stop ]]; then
exitcode=0 exitcode=0
if [ ! -e /etc/openvpn/keys/ca-server.crt ]; then if [ ! -e /etc/openvpn/keys/ca-server.crt ]; then
@@ -197,31 +199,33 @@ if [[ ! "${1}" =~ stop ]]; then
fi fi
[ "${exitcode}" -ne 0 ] && exit ${exitcode} [ "${exitcode}" -ne 0 ] && exit ${exitcode}
fi fi
# Variables # Variables
echo -n "Retrieving Yunohost settings... " echo -n "Retrieving Yunohost settings... "
ynh_server_name=$(moulinette_get server_name) ynh_server_name=$(moulinette_get server_name)
ynh_server_port=$(moulinette_get server_port) ynh_server_port=$(moulinette_get server_port)
ynh_server_proto=$(moulinette_get server_proto) ynh_server_proto=$(moulinette_get server_proto)
ynh_ip6_addr=$(moulinette_get ip6_addr) ynh_ip6_addr=$(moulinette_get ip6_addr)
ynh_login_user=$(moulinette_get login_user) ynh_login_user=$(moulinette_get login_user)
old_ip6_gw=$(moulinette_get ip6_gw) old_ip6_gw=$(moulinette_get ip6_gw)
old_wired_device=$(moulinette_get wired_device) old_wired_device=$(moulinette_get wired_device)
old_server_ip6=$(moulinette_get server_ip6) old_server_ip6=$(moulinette_get server_ip6)
new_ip6_gw=$(ip -6 route | grep default\ via | awk '{ print $3 }') new_ip6_gw=$(ip -6 route | grep default\ via | awk '{ print $3 }')
new_wired_device=$(ip route | awk '/default via/ { print $NF; }') new_wired_device=$(ip route | awk '/default via/ { print $NF; }')
new_server_ip6=$(host "${ynh_server_name}" | awk '/IPv6/ { print $NF; }') new_server_ip6=$(host "${ynh_server_name}" | awk '/IPv6/ { print $NF; }')
if [ -z "${new_server_ip6}" ]; then if [ -z "${new_server_ip6}" ]; then
new_server_ip6=$(host "${ynh_server_name}" 80.67.188.188 | awk '/IPv6/ { print $NF; }') new_server_ip6=$(host "${ynh_server_name}" 80.67.188.188 | awk '/IPv6/ { print $NF; }')
fi fi
echo "OK" echo "OK"
fi
# Script # Script
@@ -306,6 +310,10 @@ case "${1}" in
service ynh-hotspot start service ynh-hotspot start
fi fi
;; ;;
restart)
$0 stop
$0 start
;;
status) status)
exitcode=0 exitcode=0
@@ -358,7 +366,7 @@ case "${1}" in
exit ${exitcode} exit ${exitcode}
;; ;;
*) *)
echo "Usage: $0 {start|stop|litestop|status}" echo "Usage: $0 {start|stop|litestop|restart|status}"
exit 1 exit 1
;; ;;
esac esac

View File

@@ -18,7 +18,7 @@
location <TPL:NGINX_LOCATION> { location <TPL:NGINX_LOCATION> {
alias <TPL:NGINX_REALPATH>; alias <TPL:NGINX_REALPATH>;
if($scheme = http) { if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent; rewrite ^ https://$server_name$request_uri? permanent;
} }