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

  • 相关阅读:
    Objective-C中#define的常见用法
    OpenGL ES为缓存提供数据的7个步骤
    绕指定点旋转算法
    矩阵平移旋转缩放公式
    矩阵和向量的乘法顺序
    干货集合
    RGB颜色空间与YCbCr颜色空间的互转
    UINavi中push控制器的时候隐藏TabBar
    CZLayer的阴影
    CALayer初认识
  • 原文地址:https://www.cnblogs.com/qingxiaoping/p/13203212.html
Copyright © 2011-2022 走看看