using docker to deploy Lnmp+redis,phalcon framework has been going on for several days, one question after another.
the problem now is that the phpinfo opens normally, the html page is normal, the php test script can be run, and the phalcon module is loaded, which is to visit php page 404. no, no, no.
php,nginx are all root permissions, and directories are all given to 777.
check the log, but the file was not found.
2019/01/14 12:58:34 [error] 6-sharp6: *2 open() "/home/wwwroot/t5/main/cloud.feimarobotics.com/public/favicon.ico" failed (2: No such file or directory), client: 218.17.15.18, server: , request: "GET /favicon.ico HTTP/1.1", host: "129.211.1.18:11084"
2019/01/14 13:02:40 [error] 6-sharp6: *3 open() "/home/wwwroot/t5/main/cloud.feimarobotics.com/public/user/login" failed (2: No such file or directory), client: 218.17.15.18, server: , request: "GET /user/login HTTP/1.1", host: "129.211.1.18:11084"
deployed on the CVM: http://129.211.1.18:11084/user/login
docker-compose.yml
-sharp 11084 cloud.feimarobotics.com, 8080 admin.feimarobotics.com, 8081 api.feimarobotics.com
version: "3"
services:
php:
container_name: php_service
image: php_service:1.0
ports:
- "9000:9000"
volumes:
- /home:/home
networks:
- "net1"
nginx:
container_name: nginx_service
image: nginx_service:1.0
depends_on:
- php
ports:
- "11084:11084"
- "8080:8080"
- "8081:8081"
volumes:
- /home:/home
networks:
- "net1"
redis:
container_name: redis_service
image: redis:3.0.6
ports:
- "6379:6379"
volumes:
- /home/dockerconf/redis/redis.conf:/etc/redis/redis.conf:ro
networks:
- "net1"
networks:
net1:
driver: bridge
nginx.conf
user nginx;
worker_processes auto;
error_log /home/wwwlogs/error.log crit;
pid /var/run/nginx.pid;
worker_rlimit_nofile 51200;
events {
use epoll;
worker_connections 51200;
multi_accept on;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
server_names_hash_bucket_size 128;
client_header_buffer_size 32k;
large_client_header_buffers 4 32k;
client_max_body_size 50m;
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;
tcp_nodelay on;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_buffer_size 64k;
fastcgi_buffers 4 64k;
fastcgi_busy_buffers_size 128k;
fastcgi_temp_file_write_size 256k;
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
gzip_vary on;
gzip_proxied expired no-cache no-store private auth;
gzip_disable "MSIE [1-6]\.";
server_tokens off;
include /etc/nginx/conf.d/*.conf;
}
default.conf
server {
listen 11084;
-sharpserver_name cloud.feimarobotics.com;
set $root_path "/home/wwwroot/t5/main/cloud.feimarobotics.com/public";
root $root_path;
-sharpcharset koi8-r;
access_log /home/wwwlogs/cloud.feimarobogics.com.log main;
error_log /home/wwwlogs/cloud.feimarobotics.com.error.log error;
location / {
root $root_path;
index index.html index.htm index.php index;
}
-sharperror_page 404 /404.html;
-sharp redirect server error pages to the static page /50x.html
-sharp
-sharperror_page 500 502 503 504 /50x.html;
location = /50x.html {
root $root_path;
}
location ~* ^/(css|img|js|flv|swf|download|html)/(.+)$ {
root $root_path;
}
-sharp proxy the PHP scripts to Apache listening on 127.0.0.1:80
-sharp
-sharplocation ~ \.php$ {
-sharp proxy_pass http://127.0.0.1;
-sharp}
-sharp pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
-sharp
location ~ \.php$ {
root $root_path;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
fastcgi_param SCRIPT_FILENAME /home/wwwroot/t5/main/cloud.feimarobotics.com/public$fastcgi_script_name;
include fastcgi_params;
}
-sharp deny access to .htaccess files, if Apache"s document root
-sharp concurs with nginx"s one
-sharp
-sharplocation ~ /\.ht {
-sharp deny all;
-sharp}
}