Remove nginx
This commit is contained in:
parent
9ffc46f247
commit
51dad34940
3 changed files with 6 additions and 63 deletions
|
@ -99,7 +99,6 @@ RUN apt-get update -qq -y &&\
|
||||||
gosu \
|
gosu \
|
||||||
busybox-syslogd \
|
busybox-syslogd \
|
||||||
tzdata \
|
tzdata \
|
||||||
nginx-light \
|
|
||||||
-qq -y --no-install-recommends &&\
|
-qq -y --no-install-recommends &&\
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
worker_processes auto;
|
|
||||||
error_log off;
|
|
||||||
user weewx;
|
|
||||||
|
|
||||||
events {
|
|
||||||
worker_connections 1024;
|
|
||||||
}
|
|
||||||
|
|
||||||
http {
|
|
||||||
server_tokens off;
|
|
||||||
access_log off;
|
|
||||||
|
|
||||||
include /etc/nginx/mime.types;
|
|
||||||
|
|
||||||
sendfile on;
|
|
||||||
tcp_nopush on;
|
|
||||||
|
|
||||||
gzip on;
|
|
||||||
gzip_vary on;
|
|
||||||
gzip_types text/plain text/css text/xml text/javascript application/x-javascript application/xml;
|
|
||||||
|
|
||||||
map $http_x_forwarded_proto $pass_scheme {
|
|
||||||
default $http_x_forwarded_proto;
|
|
||||||
'' $scheme;
|
|
||||||
}
|
|
||||||
|
|
||||||
map $http_x_forwarded_host $pass_host {
|
|
||||||
default $http_x_forwarded_host;
|
|
||||||
'' $host;
|
|
||||||
}
|
|
||||||
|
|
||||||
server {
|
|
||||||
listen 8000;
|
|
||||||
|
|
||||||
root /data/html/wdc;
|
|
||||||
index index.html;
|
|
||||||
|
|
||||||
location ~* \.html$ {
|
|
||||||
expires modified 120s;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~* \.(js|css)$ {
|
|
||||||
expires 1h;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ ^/dwd/(icons|warn_icons)/ {
|
|
||||||
root /home/weewx/public_html;
|
|
||||||
expires 7d;
|
|
||||||
}
|
|
||||||
|
|
||||||
location ~ ^/dwd/[\w]+\.(gif|png) {
|
|
||||||
expires modified 1h;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -19,13 +19,6 @@ if [ "$(id -u)" = 0 ]; then
|
||||||
# start the syslog daemon as root
|
# start the syslog daemon as root
|
||||||
/sbin/syslogd -n -S -O - &
|
/sbin/syslogd -n -S -O - &
|
||||||
|
|
||||||
# start nginx
|
|
||||||
if [ -e /data/nginx.conf ]; then
|
|
||||||
nginx -c /data/nginx.conf
|
|
||||||
else
|
|
||||||
nginx -c /defaults/nginx.conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
# setup cron
|
# setup cron
|
||||||
if [ -e /data/cron/dwd ]; then
|
if [ -e /data/cron/dwd ]; then
|
||||||
cp /data/cron/dwd /etc/cron.hourly/
|
cp /data/cron/dwd /etc/cron.hourly/
|
||||||
|
@ -47,6 +40,12 @@ if [ "$(id -u)" = 0 ]; then
|
||||||
ln -s /defaults/skin-wdc/skin.conf ./skins/weewx-wdc/skin.conf
|
ln -s /defaults/skin-wdc/skin.conf ./skins/weewx-wdc/skin.conf
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# skin: move dwd icons
|
||||||
|
mkdir /data/static_html
|
||||||
|
cp -r ./public_html/dwd /data/static_html
|
||||||
|
chown -R "${WEEWX_UID:-weewx}:${WEEWX_GID:-weewx}" /data/static_html
|
||||||
|
chmod 444 /data/static_html/dwd/{icons,warn_icons}/*
|
||||||
|
|
||||||
if [ "${WEEWX_UID:-weewx}" != 0 ]; then
|
if [ "${WEEWX_UID:-weewx}" != 0 ]; then
|
||||||
# drop privileges and restart this script
|
# drop privileges and restart this script
|
||||||
echo "Switching uid:gid to ${WEEWX_UID:-weewx}:${WEEWX_GID:-weewx}"
|
echo "Switching uid:gid to ${WEEWX_UID:-weewx}:${WEEWX_GID:-weewx}"
|
||||||
|
|
Reference in a new issue