use env to force https

This commit is contained in:
virusdefender
2017-12-16 01:38:44 +08:00
parent 417337c4d2
commit 9542b2e5f7
4 changed files with 13 additions and 2 deletions

8
deploy/run.sh Normal file → Executable file
View File

@@ -23,6 +23,14 @@ if [ ! -f "$SSL/server.key" ]; then
-subj "/C=CN/ST=Beijing/L=Beijing/O=Beijing OnlineJudge Technology Co., Ltd./OU=Service Infrastructure Department/CN=`hostname`" -nodes
fi
cd $APP/deploy/nginx
ln -sf locations.conf https_locations.conf
if [ -z "$FORCE_HTTPS" ]; then
ln -sf locations.conf http_locations.conf
else
ln -sf https_redirect.conf http_locations.conf
fi
cd $APP
n=0