mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-09-21 08:23:20 +00:00
use env to force https
This commit is contained in:
parent
417337c4d2
commit
9542b2e5f7
3
deploy/nginx/https_redirect.conf
Normal file
3
deploy/nginx/https_redirect.conf
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
location / {
|
||||||
|
return 301 https://$host$request_uri;
|
||||||
|
}
|
@ -36,7 +36,7 @@ http {
|
|||||||
listen 8000 default_server;
|
listen 8000 default_server;
|
||||||
server_name _;
|
server_name _;
|
||||||
|
|
||||||
include common.conf;
|
include http_locations.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
@ -49,7 +49,7 @@ http {
|
|||||||
ssl_prefer_server_ciphers on;
|
ssl_prefer_server_ciphers on;
|
||||||
ssl_session_cache shared:SSL:10m;
|
ssl_session_cache shared:SSL:10m;
|
||||||
|
|
||||||
include common.conf;
|
include https_locations.conf;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
8
deploy/run.sh
Normal file → Executable file
8
deploy/run.sh
Normal file → Executable 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
|
-subj "/C=CN/ST=Beijing/L=Beijing/O=Beijing OnlineJudge Technology Co., Ltd./OU=Service Infrastructure Department/CN=`hostname`" -nodes
|
||||||
fi
|
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
|
cd $APP
|
||||||
|
|
||||||
n=0
|
n=0
|
||||||
|
Loading…
Reference in New Issue
Block a user