zoukankan      html  css  js  c++  java
  • Docker 学习第三课

    搭建NGINX + PH-FPM

    1、修改NGINX配置文件

    user  nginx;
    worker_processes  auto;
    
    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;
    
          location / {
                root /var/www/html;
                index index.php index.html;
          }
    
    
          # php解析
          location ~ .php$ {
                root           /php;
                fastcgi_pass   192.138.0.5:9000;
                fastcgi_index  index.php;
                fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
                include        fastcgi_params;
          }
       }
    }

    2、启动php-fpm容器

    docker run -d --name php-fpm -v /root/php/:/php/ --network nginx-net --ip 192.138.0.6 php:7.2.0-fpm-alpine3.6

    3、启动Nginx容器

    docker run -d -p 80:80 --rm --name nginx -v /root/php/:/usr/share/nginx/html -v /root/conf/nginx.conf:/etc/nginx/nginx.conf --network nginx-net nginx:1.19.0-alpine

  • 相关阅读:
    制造者为什么重要
    归因理论
    初创业谨记有三法宝:顶梁柱、现金牛、北极星
    华特迪士尼语录
    说好一个创业故事的5个步骤
    接口
    抽象类_模板方法设计模式
    抽象类与抽象方法
    非static和static初始化块
    单例设计模式
  • 原文地址:https://www.cnblogs.com/qingxiaoping/p/13203212.html
Copyright © 2011-2022 走看看