码迷,mamicode.com
首页 > 其他好文 > 详细

ngnix install

时间:2019-09-16 13:30:56      阅读:79      评论:0      收藏:0      [点我收藏+]

标签:end   nts   cte   rest   cat   main   mat   mime   time   

docker : 官网:https://hub.docker.com/_/nginx

 

step 1:

sudo docker pull nginx

 

step2 :

sudo mkdir  -p  /data/ngnix
vi ngnix.conf

  

ngnix.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;
}

 

step 3:

sudo docker run -itd --restart unless-stopped -p 80:80 -v /data/ngnix/ngnix.conf:/etc/nginx/nginx.conf nginx

 

ngnix install

标签:end   nts   cte   rest   cat   main   mat   mime   time   

原文地址:https://www.cnblogs.com/lshan/p/11526636.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!