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:
- 80:80
volumes:
- ./:/srv
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./data:/srv
- ./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;
worker_processes 1;
server{
listen 80;
server_name _;
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;
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;
}
location / {
root /srv;
# Activate the next line if you want to list files
# autoindex on;
}
}