Boilerplate for nginx static file server

This commit is contained in:
nicco 2018-07-24 12:18:50 +02:00
parent af19fbeb56
commit 38b0bcf0cd
3 changed files with 9 additions and 37 deletions

View File

@ -7,5 +7,5 @@ services:
ports: ports:
- 80:80 - 80:80
volumes: volumes:
- ./:/srv - ./data:/srv
- ./nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx.conf:/etc/nginx/conf.d/default.conf

View File

@ -1,2 +0,0 @@
FROM nginx:alpine

View File

@ -1,36 +1,10 @@
user nginx; server{
worker_processes 1; listen 80;
server_name _;
error_log /var/log/nginx/error.log warn; location / {
pid /var/run/nginx.pid; root /srv;
# Activate the next line if you want to list files
events { # autoindex on;
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
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;
keepalive_timeout 65;
gzip on;
server{
listen 80;
server_name _;
location / {
root /srv;
autoindex on;
}
} }
} }