Browse Source

initial alpine nginx

Steve Thielemann 5 years ago
commit
2b2483b5f5
8 changed files with 137 additions and 0 deletions
  1. 7 0
      README.md
  2. 45 0
      default.conf
  3. 16 0
      docker-compose.yml
  4. 7 0
      html/404.html
  5. 7 0
      html/50x.html
  6. 9 0
      html/index.html
  7. 8 0
      image/Dockerfile
  8. 38 0
      nginx.conf

+ 7 - 0
README.md

@@ -0,0 +1,7 @@
+
+This is nginx -- that hides (sort of) what it is and version.
+
+The bad:  It doesn't turn off nginx in the error pages.  (So you must
+define the error pages somewhere.)  If you don't you get nginx errors.
+
+

+ 45 - 0
default.conf

@@ -0,0 +1,45 @@
+server {
+    listen       80;
+    server_name  localhost;
+
+    #charset koi8-r;
+    #access_log  /var/log/nginx/host.access.log  main;
+
+    location / {
+        root   /usr/share/nginx/html;
+        index  index.html index.htm;
+    }
+
+    error_page  404              /404.html;
+
+    # 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;
+    }
+
+    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+    #
+    #location ~ \.php$ {
+    #    proxy_pass   http://127.0.0.1;
+    #}
+
+    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+    #
+    #location ~ \.php$ {
+    #    root           html;
+    #    fastcgi_pass   127.0.0.1:9000;
+    #    fastcgi_index  index.php;
+    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
+    #    include        fastcgi_params;
+    #}
+
+    # deny access to .htaccess files, if Apache's document root
+    # concurs with nginx's one
+    #
+    #location ~ /\.ht {
+    #    deny  all;
+    #}
+}
+

+ 16 - 0
docker-compose.yml

@@ -0,0 +1,16 @@
+
+version: "2"
+
+services:
+  www:
+    build: image
+    # image: nginx:alpine
+    volumes:
+      # - ~/dev/docker/nginx/html:/usr/share/nginx/html:ro
+      - ./default.conf:/etc/nginx/conf.d/default.conf:ro
+      - ./nginx.conf:/etc/nginx/nginx.conf:ro
+      - ./html:/usr/share/nginx/html:ro
+
+    ports:
+      - "8001:80"
+

+ 7 - 0
html/404.html

@@ -0,0 +1,7 @@
+<html>
+<head><title>404 Not Found</title></head>
+<body>
+<center><h1>404 Not Found</h1></center>
+<hr><center>bz&bz</center>
+</body>
+</html>

+ 7 - 0
html/50x.html

@@ -0,0 +1,7 @@
+<html>
+<head><title>500 Internal Server Error</title></head>
+<body>
+<center><h1>500 Internal Server Error</h1></center>
+<hr><center>bz&bz</center>
+</body>
+</html>

+ 9 - 0
html/index.html

@@ -0,0 +1,9 @@
+<html>
+<head>
+<title>Welcome</title>
+</head>
+<body>
+<h1>Welcome</h1>
+<p>Welcome to nginx</p>
+</body>
+</html>

+ 8 - 0
image/Dockerfile

@@ -0,0 +1,8 @@
+FROM alpine:3.10
+LABEL maintainer="Bugz Software <[email protected]>"
+STOPSIGNAL SIGTERM
+RUN apk --no-cache add nginx nginx-mod-http-headers-more \
+nginx-mod-http-image-filter nginx-mod-http-geoip \
+nginx-mod-stream nginx-mod-stream-geoip nginx-mod-http-xslt-filter \
+&& mkdir -p /run/nginx
+CMD ["nginx", "-g", "daemon off;"]

+ 38 - 0
nginx.conf

@@ -0,0 +1,38 @@
+
+# This is not needed.
+load_module modules/ngx_http_headers_more_filter_module.so;
+
+user  nginx;
+worker_processes  auto;
+
+error_log  /var/log/nginx/error.log warn;
+pid        /var/run/nginx.pid;
+
+
+events {
+    worker_connections  1024;
+}
+
+
+http {
+    include       /etc/nginx/mime.types;
+    default_type  application/octet-stream;
+
+    more_set_headers "Server: bz&bz";
+    server_tokens off;
+
+    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
+                      '$status $body_bytes_sent "$http_referer" '
+                      '"$http_user_agent" "$http_x_forwarded_for"';
+
+    access_log  /var/log/nginx/access.log  main;
+
+    sendfile        on;
+    #tcp_nopush     on;
+
+    keepalive_timeout  65;
+
+    #gzip  on;
+
+    include /etc/nginx/conf.d/*.conf;
+}