Skip to content
This repository was archived by the owner on Apr 7, 2022. It is now read-only.

Commit 38b0bcf

Browse files
committed
Boilerplate for nginx static file server
1 parent af19fbe commit 38b0bcf

File tree

3 files changed

+10
-38
lines changed

3 files changed

+10
-38
lines changed

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ services:
77
ports:
88
- 80:80
99
volumes:
10-
- ./:/srv
11-
- ./nginx.conf:/etc/nginx/nginx.conf:ro
10+
- ./data:/srv
11+
- ./nginx.conf:/etc/nginx/conf.d/default.conf

dockerfile

Lines changed: 0 additions & 2 deletions
This file was deleted.

nginx.conf

Lines changed: 8 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,10 @@
1-
user nginx;
2-
worker_processes 1;
3-
4-
error_log /var/log/nginx/error.log warn;
5-
pid /var/run/nginx.pid;
6-
7-
events {
8-
worker_connections 1024;
9-
}
10-
11-
http {
12-
include /etc/nginx/mime.types;
13-
default_type application/octet-stream;
14-
15-
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
16-
'$status $body_bytes_sent "$http_referer" '
17-
'"$http_user_agent" "$http_x_forwarded_for"';
18-
19-
access_log /var/log/nginx/access.log main;
20-
21-
sendfile on;
22-
23-
keepalive_timeout 65;
24-
25-
gzip on;
26-
27-
server{
28-
listen 80;
29-
server_name _;
30-
31-
location / {
32-
root /srv;
33-
autoindex on;
34-
}
1+
server{
2+
listen 80;
3+
server_name _;
4+
5+
location / {
6+
root /srv;
7+
# Activate the next line if you want to list files
8+
# autoindex on;
359
}
3610
}

0 commit comments

Comments
 (0)