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