Browse Source

Add: nginx.conf. Change: Dockerfile, README

master
Siroco 7 months ago
parent
commit
3a4ec8de33
Signed by: siroco
GPG Key ID: 1324098302A514B0
  1. 22
      Dockerfile
  2. 9
      README.md
  3. 59
      nginx.conf

22
Dockerfile

@ -4,16 +4,24 @@ RUN apt-get update && \
apt-get -qy install nginx-full && \
apt-get clean
RUN mkdir /var/lib/nginx/body && \
mkdir /var/lib/nginx/proxy && \
mkdir /var/lib/nginx/fastcgi && \
mkdir /var/lib/nginx/scgi && \
mkdir /var/lib/nginx/uwsgi
COPY nginx.conf /etc/nginx/nginx.conf
# Basic nginx directories
RUN mkdir -p /var/lib/nginx/body && \
mkdir -p /var/lib/nginx/proxy && \
mkdir -p /var/lib/nginx/fastcgi && \
mkdir -p /var/lib/nginx/scgi && \
mkdir -p /var/lib/nginx/uwsgi
RUN chmod -R 777 /var/log/nginx
# Logging to stdout
RUN ln -sf /proc/self/fd /dev/
# PID nginx for non-root users
RUN mkdir -p /run/nginx && \
chmod 777 /run/nginx
EXPOSE 8080
VOLUME /etc/nginx/
CMD /usr/sbin/nginx -g "daemon off; master_process off;"
CMD /usr/sbin/nginx

9
README.md

@ -1,3 +1,10 @@
# Nginx
Simple Nginx server
Simple Nginx web server, standalone, non-root user
# Related links
* https://newbedev.com/have-nginx-access-log-and-error-log-log-to-stdout-and-stderr-of-master-process
* https://docs.nginx.com/nginx/admin-guide/monitoring/logging/
* https://nginx.org/en/docs/ngx_core_module.html
* https://nginx.org/en/docs/switches.html
* https://www.nginx.com/resources/wiki/start/topics/tutorials/commandline/

59
nginx.conf

@ -0,0 +1,59 @@
worker_processes auto;
pid /run/nginx/nginx.pid;
error_log stderr info;
daemon off;
master_process off;
include /etc/nginx/modules-enabled/*.conf;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
server_names_hash_bucket_size 128;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# SSL Settings
##
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
##
# Logging Settings
##
access_log /dev/stdout;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
Loading…
Cancel
Save