Skip to content

Commit 97c0903

Browse files
authored
Merge pull request hestiacp#1932 from hestiacp/nginx-agents
Nginx user-agents
2 parents c33c8ae + b205116 commit 97c0903

File tree

5 files changed

+27
-1
lines changed

5 files changed

+27
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
55

66
### Features
77

8+
- Add nginx user_agent separation to desktop/mobile (e.g. for fastcgi cache)
89

910
### Bugfixes
1011

install/deb/nginx/agents.conf

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
map $http_user_agent $mobile_request {
2+
default desktopversion;
3+
4+
"~*ipad" mobileversion;
5+
"~*android.*mobile" mobileversion;
6+
"~*iphone" mobileversion;
7+
"~*ipod.*mobile" mobileversion;
8+
"~*BlackBerry*Mobile Safari" mobileversion;
9+
"~*BB*Mobile Safari" mobileversion;
10+
"~*Opera.*Mini/7" mobileversion;
11+
"~*IEMobile/10.*Touch" mobileversion;
12+
"~*IEMobile/11.*Touch" mobileversion;
13+
"~*IEMobile/7.0" mobileversion;
14+
"~*IEMobile/9.0" mobileversion;
15+
"~*Firefox.*Mobile" mobileversion;
16+
"~*webOS" mobileversion;
17+
}

install/hst-install-debian.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1237,6 +1237,7 @@ echo "[ * ] Configuring NGINX..."
12371237
rm -f /etc/nginx/conf.d/*.conf
12381238
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
12391239
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1240+
cp -f $HESTIA_INSTALL_DIR/nginx/agents.conf /etc/nginx/conf.d/
12401241
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
12411242
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
12421243
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/

install/hst-install-ubuntu.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1277,6 +1277,7 @@ echo "[ * ] Configuring NGINX..."
12771277
rm -f /etc/nginx/conf.d/*.conf
12781278
cp -f $HESTIA_INSTALL_DIR/nginx/nginx.conf /etc/nginx/
12791279
cp -f $HESTIA_INSTALL_DIR/nginx/status.conf /etc/nginx/conf.d/
1280+
cp -f $HESTIA_INSTALL_DIR/nginx/agents.conf /etc/nginx/conf.d/
12801281
cp -f $HESTIA_INSTALL_DIR/nginx/phpmyadmin.inc /etc/nginx/conf.d/
12811282
cp -f $HESTIA_INSTALL_DIR/nginx/phppgadmin.inc /etc/nginx/conf.d/
12821283
cp -f $HESTIA_INSTALL_DIR/logrotate/nginx /etc/logrotate.d/

install/upgrade/versions/1.4.4.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@
66
####### Place additional commands below. #######
77
#######################################################################################
88

9+
10+
if [ -d "/etc/nginx/conf.d/" ]; then
11+
#Add nginx user_agent separation to desktop/mobile
12+
cp -f $HESTIA_INSTALL_DIR/nginx/agents.conf /etc/nginx/conf.d/
13+
fi
14+
915
# Reset PMA SSO to fix bug with Nginx + Apache2
1016
if [ "$PHPMYADMIN_KEY" != "" ]; then
1117
echo "[ * ] Refressh hestia-sso for PMA..."
1218
$BIN/v-delete-sys-pma-sso
1319
$BIN/v-add-sys-pma-sso
14-
fi
20+
fi

0 commit comments

Comments
 (0)