2017-12-20 18:02:37 -05:00
|
|
|
#!/usr/bin/with-contenv bash
|
|
|
|
|
2018-10-19 02:24:44 -04:00
|
|
|
# Create required folders
|
2018-08-02 05:48:47 -04:00
|
|
|
mkdir -p /tmp/nginx/body \
|
|
|
|
/var/log/nginx \
|
2018-08-20 18:33:51 -04:00
|
|
|
/data/nginx \
|
2018-08-22 00:31:03 -04:00
|
|
|
/data/custom_ssl \
|
2018-08-20 18:33:51 -04:00
|
|
|
/data/logs \
|
|
|
|
/data/access \
|
|
|
|
/data/nginx/proxy_host \
|
|
|
|
/data/nginx/redirection_host \
|
|
|
|
/data/nginx/stream \
|
|
|
|
/data/nginx/dead_host \
|
|
|
|
/data/nginx/temp \
|
|
|
|
/var/lib/nginx/cache/public \
|
|
|
|
/var/lib/nginx/cache/private
|
2018-07-31 01:18:09 -04:00
|
|
|
|
2018-08-02 05:48:47 -04:00
|
|
|
touch /var/log/nginx/error.log && chmod 777 /var/log/nginx/error.log
|
2017-12-20 18:02:37 -05:00
|
|
|
chown root /tmp/nginx
|
2018-07-31 01:18:09 -04:00
|
|
|
|
2018-10-19 02:24:44 -04:00
|
|
|
# Dynamically generate resolvers file
|
|
|
|
echo resolver $(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf) ";" > /etc/nginx/conf.d/include/resolvers.conf
|
|
|
|
|
|
|
|
# Run
|
2018-08-02 05:48:47 -04:00
|
|
|
exec nginx
|