mirror of
https://github.com/cupcakearmy/docker-nginx-static-server.git
synced 2024-12-21 15:56:29 +00:00
Boilerplate for nginx static file server
This commit is contained in:
parent
af19fbeb56
commit
38b0bcf0cd
@ -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
|
@ -1,2 +0,0 @@
|
||||
FROM nginx:alpine
|
||||
|
40
nginx.conf
40
nginx.conf
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user