这基本上是我here问题的延伸。我现在已经添加了存储文件夹的权限,我不再得到500错误。但现在我得到了404。
http://localhost:8888/images/content/test/myimage.jpg
/var/www/public/images/content/test/myimage.jpg
我的nginx
-config如下:
user nginx;
worker_processes 2;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
worker_rlimit_nofile 100000;
events {
worker_connections 2048;
}
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;
server {
listen 8888;
root /var/www/public;
index index.php index.html index.htm;
client_max_body_size 100m;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ ^/.+\.php(/|$) {
fastcgi_pass app:9000;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}
}
我的猜测是上面的配置有问题,但我不知道它可能是什么。我已经尝试过here建议的解决方案,但它根本没有任何区别。
有谁知道该怎么办?
它可能是这一行的路径:location ~ ^/.+\.php(/|$)
试试这样:
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;