国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 網(wǎng)站 > Nginx > 正文

CentOS7 Docker Nginx部署及運(yùn)行詳解

2024-08-30 12:22:55
字體:
供稿:網(wǎng)友
這篇文章主要介紹了CentOS7 Docker Nginx部署及運(yùn)行詳解,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧

網(wǎng)上找了一些資料部署,出現(xiàn)不一樣的問題,現(xiàn)在總結(jié)一下自己的部署流程。

1、資源準(zhǔn)備

Dockerfile文件

# "ported" by Adam Miller <maxamillion@fedoraproject.org> from #  https://github.com/fedora-cloud/Fedora-Dockerfiles # # Originally written for Fedora-Dockerfiles by #  scollier <scollier@redhat.com>  FROM centos:centos7 MAINTAINER The CentOS Project <cloud-ops@centos.org>  RUN yum -y update; yum clean all RUN yum -y install epel-release tar ; yum clean all RUN yum -y install nginx ; yum clean all ADD nginx.conf /opt/deploy/nginx/nginx.conf RUN echo "daemon off;" >> /opt/deploy/nginx/nginx.conf #RUN curl https://git.centos.org/sources/httpd/c7/acf5cccf4afaecf3afeb18c50ae59fd5c6504910 / #  | tar -xz -C /usr/local/nginx/html / #  --strip-components=1 #RUN sed -i -e 's/Apache/nginx/g' -e '/apache_pb.gif/d' /  #  /usr/local/nginx/html/index.html  EXPOSE 80  #CMD [ "/usr/local/nginx/sbin" ] 

注意:路徑需要在系統(tǒng)上面存在以及對(duì)應(yīng)

nginx.conf文件

# For more information on configuration, see: #  * Official English Documentation: http://nginx.org/en/docs/ #  * Official Russian Documentation: http://nginx.org/ru/docs/  user nginx; worker_processes 1;  error_log /usr/logs/nginx/error.log; #error_log /var/log/nginx/error.log notice; #error_log /var/log/nginx/error.log info;  pid    /run/nginx.pid;   events {   worker_connections 1024; }   http {   include    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 /usr/logs/nginx/access.log main;    sendfile    on;   #tcp_nopush   on;    #keepalive_timeout 0;   keepalive_timeout 65;    #gzip on;    # Load modular configuration files from the /etc/nginx/conf.d directory.   # See http://nginx.org/en/docs/ngx_core_module.html#include   # for more information.   #include /etc/nginx/conf.d/*.conf;    index  index.html index.htm;    server {     listen    80;     server_name localhost;     root     /usr/share/nginx/html;      #charset koi8-r;      #access_log /var/log/nginx/host.access.log main;      location / {       autoindex on;     }      # redirect server error pages to the static page /40x.html     #     error_page 404       /404.html;     location = /40x.html {     }      # redirect server error pages to the static page /50x.html     #     error_page  500 502 503 504 /50x.html;     location = /50x.html {     }      # proxy the PHP scripts to Apache listening on 127.0.0.1:80     #     #location ~ /.php$ {     #  proxy_pass  http://127.0.0.1;     #}      # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000     #     #location ~ /.php$ {     #  root      html;     #  fastcgi_pass  127.0.0.1:9000;     #  fastcgi_index index.php;     #  fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;     #  include    fastcgi_params;     #}      # deny access to .htaccess files, if Apache's document root     # concurs with nginx's one     #     #location ~ //.ht {     #  deny all;     #}   }     # another virtual host using mix of IP-, name-, and port-based configuration   #   #server {   #  listen    8000;   #  listen    somename:8080;   #  server_name somename alias another.alias;   #  root     html;    #  location / {   #  }   #}     # HTTPS server   #   #server {   #  listen    443;   #  server_name localhost;   #  root     html;    #  ssl         on;   #  ssl_certificate   cert.pem;   #  ssl_certificate_key cert.key;    #  ssl_session_timeout 5m;    #  ssl_protocols SSLv2 SSLv3 TLSv1;   #  ssl_ciphers HIGH:!aNULL:!MD5;   #  ssl_prefer_server_ciphers  on;    #  location / {   #  }   #}  } 
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 河池市| 连江县| 敦化市| 车致| 汝城县| 南郑县| 电白县| 扶余县| 沙坪坝区| 徐汇区| 施甸县| 广汉市| 福安市| 保山市| 左云县| 商都县| 长宁区| 探索| 依兰县| 通榆县| 澄迈县| 长乐市| 镇巴县| 阜康市| 密山市| 湛江市| 区。| 乌拉特中旗| 本溪市| 广丰县| 云浮市| 正宁县| 台中市| 长子县| 老河口市| 永丰县| 贺兰县| 疏附县| 永修县| 濉溪县| 新化县|