[英]Error: no input file specified. Laravel with docker nginx-proxy
probably somebody faced this issue.可能有人面临这个问题。 Through the time I get error "no input file specified" from nginx.通过时间我从 nginx 收到错误“没有指定输入文件”。 There is the log from nginx container "FastCGI sent in stderr: "Unable to open primary script: /var/www/public/index.php (No such file or directory)" while reading response header from upstream".来自 nginx 容器的日志“FastCGI 在标准错误中发送:“在从上游读取响应标头时,无法打开主脚本:/var/www/public/index.php(没有这样的文件或目录)”。
It happens only for https, on local machine allright.它只发生在 https 上,在本地机器上没问题。
As you can see, sometimes I got response 200, sometimes 404, from same file.如您所见,有时我从同一个文件中得到响应 200,有时是 404。
This is my nginx config:这是我的 nginx 配置:
server {
index index.php index.html index.htm;
root /var/www/public;
location ~ /.well-known/acme-challenge {
allow all;
root /var/www;
}
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
rewrite ^/core/authorize.php/core/authorize.php(.*)$ /core/authorize.php$1;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
}
location ~ /\.ht {
deny all;
}
location = /favicon.ico {
log_not_found off; access_log off;
}
location = /robots.txt {
log_not_found off; access_log off; allow all;
}
location ~* \.(css|gif|ico|jpeg|jpg|js|png)$ {
expires max;
log_not_found off;
}
} }
I have been solved the problem.我已经解决了这个问题。 Instead nginx I set up apache, because laravel 5.8 refuses to work with nginx.相反,我设置了 apache nginx,因为 laravel 5.8 拒绝使用 nginx。 Latest version of laravel works properly with nginx in docker最新版本的 laravel 与 docker 中的 nginx 一起正常工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.