mirror of
https://github.com/QingdaoU/OnlineJudge.git
synced 2024-12-29 00:22:03 +00:00
commit
f70d3cac41
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;
|
||||
}
|
@ -19,6 +19,10 @@ location /admin {
|
||||
try_files $uri $uri/ /index.html =404;
|
||||
}
|
||||
|
||||
location /.well-known {
|
||||
alias /data/ssl/.well-known;
|
||||
}
|
||||
|
||||
location / {
|
||||
root /app/dist;
|
||||
try_files $uri $uri/ /index.html =404;
|
@ -36,7 +36,7 @@ http {
|
||||
listen 8000 default_server;
|
||||
server_name _;
|
||||
|
||||
include common.conf;
|
||||
include http_locations.conf;
|
||||
}
|
||||
|
||||
server {
|
||||
@ -49,7 +49,7 @@ http {
|
||||
ssl_prefer_server_ciphers on;
|
||||
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
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user