mirror of
https://github.com/vimagick/dockerfiles.git
synced 2025-12-21 13:23:02 +01:00
update nginx
This commit is contained in:
@@ -17,9 +17,9 @@ nginx:
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- ./data/default.conf:/etc/nginx/default.conf
|
||||
- ./data/conf.d:/etc/nginx/conf.d
|
||||
- ./data/html:/usr/share/nginx/html
|
||||
restart: always
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
## Reverse Proxy
|
||||
@@ -30,53 +30,16 @@ File: docker-compose.yml
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
volumes:
|
||||
- ./data/default.conf:/etc/nginx/conf.d/default.conf
|
||||
- ./data/conf.d:/etc/nginx/conf.d
|
||||
- ./data/ssl:/etc/nginx/ssl
|
||||
- ./data/htpasswd:/etc/nginx/htpasswd
|
||||
net: host
|
||||
restart: always
|
||||
restart: unless-stopped
|
||||
```
|
||||
|
||||
> Password file can be generated by:
|
||||
>> `echo "username:$(openssl passwd -apr1 password)" >> data/htpasswd`
|
||||
|
||||
File: nginx.conf
|
||||
|
||||
```nginx
|
||||
user nginx;
|
||||
worker_processes 4;
|
||||
|
||||
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;
|
||||
#tcp_nopush on;
|
||||
|
||||
keepalive_timeout 65;
|
||||
|
||||
#gzip on;
|
||||
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-enabled/*;
|
||||
}
|
||||
```
|
||||
|
||||
File: default
|
||||
|
||||
```nginx
|
||||
|
||||
Reference in New Issue
Block a user