Skip to content

Commit 4442311

Browse files
committed
add volume example for static file serving
1 parent 2203717 commit 4442311

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[![Dry Run](https://github.com/killroy192/template-nginx-ssl/actions/workflows/dry-run.yml/badge.svg)](https://github.com/killroy192/template-nginx-ssl/actions/workflows/dry-run.yml)
22

3+
Project inspired by https://github.com/nginx-le/nginx-le
4+
35
# TEMPLATE_NGINX_SSL
46

57
Template for simple nginx-le based container for service requests routing.

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ services:
1616
volumes:
1717
- ./etc/ssl:/etc/nginx/ssl
1818
- ./etc/service.conf:/etc/nginx/service.conf
19+
# - ./etc/service-example-2.conf:/etc/nginx/service2.conf # more services, should be service*.conf
20+
# - ~/static:/var/www/static # volume for static data hosting
1921
ports:
2022
- "80:80"
2123
- "443:443"

examples/static.routing.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ server {
55
listen 80;
66
listen 443;
77

8-
root /var/www/you-domain.com;
8+
root /var/www/static/you-domain.com;
99

1010
autoindex on;
1111

@@ -26,7 +26,7 @@ server {
2626
listen 80;
2727
listen 443;
2828

29-
root /var/www/sub.you-domain;
29+
root /var/www/static/sub.you-domain;
3030

3131
autoindex on;
3232

0 commit comments

Comments
 (0)