fix docker http2 config

This commit is contained in:
xiaomlove
2025-04-28 21:33:02 +07:00
parent d7e80231ea
commit 95be31300a
5 changed files with 11 additions and 5 deletions

View File

@@ -62,9 +62,11 @@ envsubst '$PHPMYADMIN_SERVER_NAME' < /etc/nginx/conf.d/sites/phpmyadmin.conf.tem
if [ "$USE_HTTPS" = "0" ]; then
echo_info "remove https related configuration ..."
sed -i '/ssl_certificate/d' "$APP_CONF"
sed -i '/http2/d' "$APP_CONF"
sed -i 's/listen.*/listen 80;/g' "$APP_CONF"
sed -i '/ssl_certificate/d' "$PMA_CONF"
sed -i '/http2/d' "$PMA_CONF"
sed -i 's/listen.*/listen 80;/g' "$PMA_CONF"
fi

View File

@@ -1,12 +1,13 @@
server {
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ${NP_DOMAIN};
root /var/www/html/public;
index index.php index.html;
ssl_certificate /certs/fullchain.pem;
ssl_certificate_key /certs/privkey.pem;
ssl_certificate_key /certs/private.pem;
location = /favicon.ico {
log_not_found off;

View File

@@ -1,9 +1,10 @@
server {
listen 443 ssl http2;
listen 443 ssl;
http2 on;
server_name ${PHPMYADMIN_SERVER_NAME};
ssl_certificate /certs/fullchain.pem;
ssl_certificate_key /certs/privkey.pem;
ssl_certificate_key /certs/private.pem;
location / {
proxy_pass http://phpmyadmin:80;

View File

@@ -34,6 +34,8 @@ TARGET_DIR="${ROOT_PATH}/public"
ENV_FILE="${ROOT_PATH}/.env"
VENDOR_DIR="${ROOT_PATH}/vendor"
chown -R www-data:www-data $ROOT_PATH
if [ "$SERVICE_NAME" = "php" ]; then
if [ ! -f "$ENV_FILE" ]; then
echo_info ".env file: $ENV_FILE not exists, copy $SOURCE_DIR to $TARGET_DIR ..."