Php 站点路径工作不正常
我的网站托管在Ubuntu和apache中。 当以sample.com/reports/的形式输入路径时,其工作正常。。 但是当进入sample.com/reports时,它不起作用。。我希望两者都能加载sample.com/reports/index.php nginx中已启用站点的条目为Php 站点路径工作不正常,php,apache,ubuntu,nginx,Php,Apache,Ubuntu,Nginx,我的网站托管在Ubuntu和apache中。 当以sample.com/reports/的形式输入路径时,其工作正常。。 但是当进入sample.com/reports时,它不起作用。。我希望两者都能加载sample.com/reports/index.php nginx中已启用站点的条目为 location /reports { proxy_pass host:port; proxy_set_header X-Real-IP $remote_addr; proxy_set_h
location /reports {
proxy_pass host:port;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_read_timeout 600s;
}
如何将其配置为将两者加载到同一index.php文件?使用
位置/reports/
如果位置由以斜杠字符结尾的前缀字符串定义,并且请求由proxy_pass、fastcgi_pass、scgi_pass、uwsgi_pass或memcached_pass中的一个进行处理,则响应URI等于此字符串但不带尾随斜杠的请求时,代码为301的永久重定向将返回到请求的URI,并附加斜杠
谢谢@alexeyten。。我按照你说的更改了文件。当我转到sample.com/reports/时,它仍在工作,但当我进入sample.com/reports时,它显示路径为sample.com:8000/reports/并显示一条消息“无法连接到sample:8000”。。。