【发布时间】:2019-08-22 14:02:32
【问题描述】:
这基本上是我的问题here 的扩展。我现在已经添加了存储文件夹的权限,并且不再出现 500 错误。但现在我得到了 404。
- 我正在尝试的图像 URL 是 URL:
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 建议的解决方案,但它根本没有任何区别。
有人知道该怎么做吗?
【问题讨论】:
标签: php laravel docker nginx docker-compose