Sign inSign up

ilwx/nginx

By ilwx

•Updated almost 5 years ago

official copy version 1.21.4

Image
0

1.2K

ilwx/nginx repository overview

official copy version 1.21.4

⁠使用示例:
docker run -it -d \
--name nnn \
--network host \
-v /path/to/vhost:/etc/nginx/vhost \
-v /path/to/nginx.conf:/etc/nginx/nginx.conf \
-v /path/to/webroot:/var/www/html \
--restart always \
ilwx/nginx

nginx.conf文件示例:


user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
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/vhost/*.conf;
}

vhost示例:


server {
    listen 80;

    server_name example.com;

    location / {
        root /var/www/html/example.com;
        index index.html;
    }
}


Tag summary

Content type

Image

Digest

Size

54.1 MB

Last updated

almost 5 years ago

docker pull ilwx/nginx