proxy config and install

This commit is contained in:
qiaofeng1227 2023-11-07 16:41:48 +08:00
parent 383bbc91d9
commit 3f2070fcd7
5 changed files with 18 additions and 8 deletions

View file

@ -1,4 +1,4 @@
# modify time: 202311071141, you can modify here to trigger Docker Build action
# modify time: 202311071641, you can modify here to trigger Docker Build action
# from Dockerfile: https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/Dockerfile
# from image: https://hub.docker.com/r/jc21/nginx-proxy-manager

View file

@ -108,9 +108,9 @@ server {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
add_header 'Access-Control-Allow-Origin' $http_origin;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,x-api-key';
add_header 'Access-Control-Allow-Origin' $http_origin always;
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
add_header 'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,x-api-key' always;
if ($request_method = OPTIONS) {
return 204;
}

View file

@ -133,6 +133,14 @@ install_tools(){
echo_prefix_tools=$'\n[Tools] - '
echo "$echo_prefix_tools Starting install necessary tool..."
OS_TYPE=$(cat /etc/*-release | awk -F= '/^NAME/{print $2}' | tr -d '"')
if [[ $OS_TYPE == "Red Hat Enterprise Linux" ]]; then
RHEL_VERSION=$(rpm -E %{rhel})
sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-${RHEL_VERSION}.noarch.rpm
else
echo "The script is only applicable to Red Hat Enterprise Linux."
fi
dnf --version >/dev/null 2>&1
dnf_status=$?
yum --version >/dev/null 2>&1

View file

@ -322,13 +322,15 @@ Install_Cockpit(){
for pkg in $cockpit_packages
do
echo "Install or upgrade $pkg"
sudo dnf upgrade -y "$pkg" || sudo dnf install -y "$pkg" || echo "$pkg failed to install or upgrade"
sudo dnf upgrade -y "$pkg"
sudo dnf install -y "$pkg" || echo "$pkg failed to install or upgrade"
done
elif [ $yum_status -eq 0 ]; then
for pkg in $cockpit_packages
do
echo "Install or update $pkg"
sudo yum update -y "$pkg" || sudo yum install -y "$pkg" || echo "$pkg failed to install or update"
sudo yum update -y "$pkg"
sudo yum install -y "$pkg" || echo "$pkg failed to install or update"
done
elif [ $apt_status -eq 0 ]; then
export DEBIAN_FRONTEND=noninteractive

View file

@ -63,11 +63,11 @@ Install_Docker(){
# For redhat family
if [[ -f /etc/redhat-release ]]; then
# For CentOS, Fedora, or RHEL(only s390x)
if [[ $(cat /etc/redhat-release) =~ "RHEL" ]] && [[ $(uname -m) == "s390x" ]] || [[ $(cat /etc/redhat-release) =~ "CentOS" ]] || [[ $(cat /etc/redhat-release) =~ "Fedora" ]]; then
if [[ $(cat /etc/redhat-release) =~ "Red Hat" ]] && [[ $(uname -m) == "s390x" ]] || [[ $(cat /etc/redhat-release) =~ "CentOS" ]] || [[ $(cat /etc/redhat-release) =~ "Fedora" ]]; then
curl -fsSL https://get.docker.com -o get-docker.sh
timeout $timeout sh get-docker.sh --channel stable --mirror $mirror
else
# For other distributions
# For other distributions(Redhat and Rocky linux)
sudo yum install yum-utils -y > /dev/null
sudo yum-config-manager --add-repo $repo_url
timeout $timeout sudo yum install $docker_packages -y