initial release (nginx+php ok)
This commit is contained in:
21
rootfs/app/entrypoint.sh
Executable file
21
rootfs/app/entrypoint.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/sh
|
||||
|
||||
WEBROOT=/www
|
||||
PHP=${PHP:-none}
|
||||
USERNAME=${USERNAME:-theuser}
|
||||
adduser -DH -h "${WEBROOT}" -G "nginx" -u "1000" "${USERNAME}"
|
||||
|
||||
chown "${USERNAME}:nginx" "${WEBROOT}" -R
|
||||
find "${WEBROOT}" -type d -exec chmod 0755 {} \;
|
||||
find "${WEBROOT}" -type f -exec chmod 0644 {} \;
|
||||
|
||||
envsubst < /app/nginx.conf.tpl > /etc/nginx/http.d/default.conf
|
||||
|
||||
case "${PHP}" in
|
||||
"php84") /usr/sbin/php-fpm84 -D ;;
|
||||
"php83") /usr/sbin/php-fpm83 -D ;;
|
||||
"php82") /usr/sbin/php-fpm82 -D ;;
|
||||
*) ;;
|
||||
esac
|
||||
|
||||
nginx
|
||||
46
rootfs/app/nginx.conf.tpl
Normal file
46
rootfs/app/nginx.conf.tpl
Normal file
@@ -0,0 +1,46 @@
|
||||
error_log /dev/stdout info;
|
||||
access_log /dev/stdout;
|
||||
|
||||
server {
|
||||
listen 80 default_server;
|
||||
listen [::]:80 default_server;
|
||||
root /www;
|
||||
# server_name localhost;
|
||||
|
||||
#access_log /var/log/nginx/host.access.log main;
|
||||
|
||||
location / {
|
||||
index index.html index.htm;
|
||||
|
||||
# autoindex on;
|
||||
# autoindex_exact_size off;
|
||||
# autoindex_format html;
|
||||
# autoindex_localtime on;
|
||||
}
|
||||
|
||||
#error_page 404 /404.html;
|
||||
|
||||
location = /404.html {
|
||||
internal;
|
||||
}
|
||||
|
||||
# redirect server error pages to the static page /50x.html
|
||||
#
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
include /etc/nginx/custom.d/${PHP}.conf;
|
||||
|
||||
gzip on;
|
||||
gzip_proxied any;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript text/x-js image/x-icon font/woff2 font/woff application/x-font-woff;
|
||||
gzip_vary on;
|
||||
gzip_disable "msie6";
|
||||
|
||||
etag on;
|
||||
if_modified_since exact;
|
||||
add_header Pragma "public";
|
||||
add_header Cache-Control "max-age=31536000, public";
|
||||
}
|
||||
Reference in New Issue
Block a user