【发布时间】:2021-03-18 15:37:37
【问题描述】:
问题详情
描述:添加 nginx custom.conf 对我不起作用。它显示以下错误
404 Not Found
nginx/1.18.0
但是如果我在 URL 中的类名之前添加 index.php/ 那么它工作正常
请告诉我如何使用 Elastickbeanstalk + nginx + codeigniter 设置从 url 中删除 index.php
以下是我的申请的全部细节
版本
PHP 7.4
Codeignter 3.10
部署设置
AWS
ElasticBeanstalk
NGINX
我的应用程序设置
.platform
-nginx
-conf.d
-custom.conf
-Application
-Controller
-Views
-Model
...
...
..
自定义配置 custom.conf
files:
/etc/nginx/conf.d/proxy.conf:
mode: "000644"
owner: root
group: root
content: |
server {
server_name http://domain.tld/;
root /var/www;
index index.html index.php;
# set expiration of assets to MAX for caching
location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
expires max;
log_not_found off;
}
location / {
# Check if a file or directory index file exists, else route it to index.php.
try_files $uri $uri/ /index.php;
}
location ~* \.php$ {
fastcgi_pass 127.0.0.1:9000;
include fastcgi.conf;
}
}
我的 config.php
$config['base_url'] = "http://domain.tld/";
$config['index_page'] = "";
$config['uri_protocol'] = "REQUEST_URI";
请帮忙!!!
【问题讨论】:
-
您查看过您的日志文件吗?
-
感谢您的回复,是的 nginx logs "2020/12/07 12:41:28.905128 [INFO] 执行指令:GetTailLogs 2020/12/07 12:41:28.905135 [INFO] 尾日志。 .. 2020/12/07 12:41:28.906315 [INFO] 运行命令 /bin/sh -c tail -n 100 /var/log/eb-engine.log"
标签: php codeigniter nginx