`
liunancun
  • 浏览: 34374 次
社区版块
存档分类
最新评论

Docker安装Nginx

 
阅读更多
拉取镜像
docker pull nginx

简单测试
docker run -d -p 80:80 --name nginx nginx

配置测试
docker run -d -p 80:80 -v /home/nginx/nginx.conf:/etc/nginx/nginx.conf --name nginx nginx

配置文件
user root;
worker_processes 8;
worker_cpu_affinity 00000001 00000010 00000100 00001000 00010000 00100000 01000000 10000000;

events {
  worker_connections  1024;
}

http {
  include /etc/nginx/mime.types;
  default_type application/octet-stream;
  access_log off;
  sendfile on;
  keepalive_timeout 65;

  server {
    listen 80;
    server_name localhost;
    location / {
      root /usr/share/nginx/html;
      index index.html index.htm;
    }

    error_page 500 502 503 504 /50x.html;
    location = /50x.html {
      root /usr/share/nginx/html;
    }
  }
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics