update
This commit is contained in:
		
							
								
								
									
										17
									
								
								nginx-php/Demo/SingleNode/README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								nginx-php/Demo/SingleNode/README.md
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
			
		||||
# 部署单节点 nginx-php
 | 
			
		||||
 | 
			
		||||
- 根据实际环境修改
 | 
			
		||||
    - docker-compose.yml
 | 
			
		||||
    - nginx/http.d/80.conf
 | 
			
		||||
 | 
			
		||||
- 创建目录
 | 
			
		||||
    ```
 | 
			
		||||
    grep '\<source:' docker-compose.yml | cut -d: -f2 | xargs mkdir -p
 | 
			
		||||
    ```
 | 
			
		||||
 | 
			
		||||
- 上传可能需要的前端文件到 nginx/html/ 下
 | 
			
		||||
- 启动
 | 
			
		||||
    ```
 | 
			
		||||
    docker-compose up -d
 | 
			
		||||
    ```
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										45
									
								
								nginx-php/Demo/SingleNode/docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										45
									
								
								nginx-php/Demo/SingleNode/docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,45 @@
 | 
			
		||||
services:
 | 
			
		||||
  nginx-php:
 | 
			
		||||
    image: harbor.boyachain.cn:20443/general/nginx-php:7.4
 | 
			
		||||
    container_name: nginx-php
 | 
			
		||||
    restart: "on-failure"
 | 
			
		||||
    stop_grace_period: 5m
 | 
			
		||||
    privileged: true
 | 
			
		||||
    ports:
 | 
			
		||||
    - 1080:80
 | 
			
		||||
    volumes:
 | 
			
		||||
    - type: bind
 | 
			
		||||
      source: ./nginx/html
 | 
			
		||||
      target: /var/lib/nginx/html
 | 
			
		||||
    - type: bind
 | 
			
		||||
      source: ./nginx/http.d
 | 
			
		||||
      target: /etc/nginx/http.d
 | 
			
		||||
    - type: bind
 | 
			
		||||
      source: ./nginx/log
 | 
			
		||||
      target: /var/log/nginx
 | 
			
		||||
    - type: bind
 | 
			
		||||
      source: ./php7/log
 | 
			
		||||
      target: /var/log/php7
 | 
			
		||||
 | 
			
		||||
  php81:
 | 
			
		||||
    image: harbor.boyachain.cn:20443/general/nginx-php:8.1
 | 
			
		||||
    container_name: php81
 | 
			
		||||
    restart: "on-failure"
 | 
			
		||||
    stop_grace_period: 5m
 | 
			
		||||
    privileged: true
 | 
			
		||||
    ports:
 | 
			
		||||
    - 2080:80
 | 
			
		||||
    volumes:
 | 
			
		||||
    - type: bind
 | 
			
		||||
      source: ./nginx/html
 | 
			
		||||
      target: /var/lib/nginx/html
 | 
			
		||||
    - type: bind
 | 
			
		||||
      source: ./nginx/http.d
 | 
			
		||||
      target: /etc/nginx/http.d
 | 
			
		||||
    - type: bind
 | 
			
		||||
      source: ./nginx/log
 | 
			
		||||
      target: /var/log/nginx
 | 
			
		||||
    - type: bind
 | 
			
		||||
      source: ./php81/log
 | 
			
		||||
      target: /var/log/php81
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										25
									
								
								nginx-php/Demo/SingleNode/nginx/http.d/80.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								nginx-php/Demo/SingleNode/nginx/http.d/80.conf
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,25 @@
 | 
			
		||||
server {
 | 
			
		||||
    listen 80;
 | 
			
		||||
    location /xxxx/ {}
 | 
			
		||||
    location ~ ^/xxxx/.+\.php$ {
 | 
			
		||||
        client_max_body_size         1024m;
 | 
			
		||||
        client_body_buffer_size      1024m;
 | 
			
		||||
        fastcgi_buffer_size          256k;
 | 
			
		||||
        fastcgi_buffers              8 256k;
 | 
			
		||||
        fastcgi_busy_buffers_size    512k;
 | 
			
		||||
        fastcgi_temp_file_write_size 512k;
 | 
			
		||||
        expires                      -1s;
 | 
			
		||||
        include                      fastcgi_params;
 | 
			
		||||
        try_files                    $uri =404;
 | 
			
		||||
        fastcgi_pass                 unix:/var/lib/php7/phpfpm.sock;
 | 
			
		||||
        fastcgi_index                index.php;
 | 
			
		||||
        fastcgi_param                PATH_INFO $fastcgi_path_info;
 | 
			
		||||
        fastcgi_param                SCRIPT_FILENAME $document_root$fastcgi_script_name;
 | 
			
		||||
        fastcgi_split_path_info      ^(.+\.php)(/.+)$;
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
    location / {
 | 
			
		||||
        return 403;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user