php - PHP - Docker 中的 LEMP 设置
问题描述
我确实在本地为 PHP 设置了 LEMP 堆栈。但是我遇到了一个问题,当我打开项目浏览器并尝试打开内页时,我仍然可以看到主页内容。
Example: http://mlanding.test/ -> ç†
Example: http://mlanding.test/register -> It still shows me main page content.
nginx 配置示例:
server {
listen 80;
server_name mlanding.test;
index index.php index.html;
error_log /var/log/nginx/error.mlanding.log;
access_log /var/log/nginx/access.mlanding.log;
root /var/www/mlanding.test;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location / {
try_files $uri $uri/ /index.php?$query_string;
gzip_static on;
}
}
我怎样才能解决这个重定向?
解决方案
推荐阅读
- rest - REST API:资源需要按ID过滤,但没有指定ID
- python - 遍历表以找到最佳解决方案
- error-handling - UDP协议是否有一些错误检测?
- javascript - javascript中的休息语法
- javascript - 如何实现缓存 || 权力的游戏 API
- python - pipenv 仅在主目录中安装 .venv
- php - Laravel 的干预 - JPG 提供的不支持的图像类型
- exception - 在 wso2 上抛出异常
- twitter-bootstrap - 当 .card-body 内容溢出时,在 .card-header 上同时设置 height 和 d-flex 不起作用
- rust - 如何对包含 &mut 枚举的元组进行模式匹配并在匹配臂中使用该枚举?