Nginx
docker-compose.yaml
version: '3'
services:
nginx:
restart: always
image: nginx:1.11.6-alpine
container_name: nginx
ports:
- 80:80
- 443:443
volumes:
- ./data/d:/etc/nginx/d
- ./log:/var/log/nginx
- ./conf/nginx.conf:/etc/nginx/nginx.conf
nginx.conf
[root@JRT conf]# cat nginx.conf
user nginx;
worker_processes 1;
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;
server {
listen 80 default backlog=2048;
listen 443 ssl;
server_name www.jrt.top;
ssl_certificate /etc/nginx/d/www.jrt.top.pem;
ssl_certificate_key /etc/nginx/d/www.jrt.top.key;
ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://1.117.176.116:9000;
}
}
}