1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-11-20 01:52:32 +01:00
This commit is contained in:
GilbN 2022-03-26 19:45:05 +00:00
parent 9cdfc8d304
commit 761f3c602e
2 changed files with 14 additions and 5 deletions

View File

@ -9,10 +9,10 @@ server {
location / {
sub_filter_types *;
sub_filter 'https://theme-park.dev' $scheme://TP_DOMAIN;
sub_filter 'http://theme-park.dev' $scheme://TP_DOMAIN;
sub_filter 'https://develop.theme-park.dev' $scheme://TP_DOMAIN;
sub_filter 'http://develop.theme-park.dev' $scheme://TP_DOMAIN;
sub_filter 'https://theme-park.dev' https://TP_DOMAIN;
sub_filter 'http://theme-park.dev' http://TP_DOMAIN;
sub_filter 'https://develop.theme-park.dev' https://TP_DOMAIN;
sub_filter 'http://develop.theme-park.dev' http://TP_DOMAIN;
sub_filter_once off;
try_files $uri $uri/ /index.html;
}

View File

@ -17,7 +17,16 @@ if [[ -z ${TP_DOMAIN} ]]; then
TP_DOMAIN='$http_host'
fi
sed -i "s/TP_DOMAIN;/${TP_DOMAIN}; /g" /defaults/default
if [[ -z ${TP_SCHEME} ]]; then
echo 'No scheme set, defaulting to https'
TP_SCHEME='https'
fi
DEFAULT='/defaults/default'
sed -i "s/sub_filter 'https:\/\/theme-park.dev' https:\/\/TP_DOMAIN;/sub_filter 'https:\/\/theme-park.dev' ${TP_SCHEME}:\/\/${TP_DOMAIN}; /g" ${DEFAULT}
sed -i "s/sub_filter 'http:\/\/theme-park.dev' http:\/\/TP_DOMAIN;/sub_filter 'http:\/\/theme-park.dev' ${TP_SCHEME}:\/\/${TP_DOMAIN}; /g" ${DEFAULT}
sed -i "s/sub_filter 'https:\/\/develop.theme-park.dev' https:\/\/TP_DOMAIN;/sub_filter 'https:\/\/develop.theme-park.dev' ${TP_SCHEME}:\/\/${TP_DOMAIN}; /g" ${DEFAULT}
sed -i "s/sub_filter 'http:\/\/develop.theme-park.dev' http:\/\/TP_DOMAIN;/sub_filter 'http:\/\/develop.theme-park.dev' ${TP_SCHEME}:\/\/${TP_DOMAIN}; /g" ${DEFAULT}
cp /defaults/default /config/nginx/site-confs
# make our folders and links