Archived
1
0
Fork 0

Remove nginx

This commit is contained in:
Daniel Kempkens 2023-03-24 21:47:54 +01:00
parent 9ffc46f247
commit 51dad34940
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM
3 changed files with 6 additions and 63 deletions

View file

@ -99,7 +99,6 @@ RUN apt-get update -qq -y &&\
gosu \
busybox-syslogd \
tzdata \
nginx-light \
-qq -y --no-install-recommends &&\
rm -rf /var/lib/apt/lists/*

View file

@ -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;
}
}
}

View file

@ -19,13 +19,6 @@ if [ "$(id -u)" = 0 ]; then
# start the syslog daemon as root
/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
if [ -e /data/cron/dwd ]; then
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
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
# drop privileges and restart this script
echo "Switching uid:gid to ${WEEWX_UID:-weewx}:${WEEWX_GID:-weewx}"