Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
123 views
in Technique[技术] by (71.8m points)

nginx服务器URL无法自动添加index.php

请教个nginx问题,添加try_files $uri $uri/index.php /index.php?$query_string;,类似www.mydomain.com/admin这样的URL可以解析,但是单纯访问www.mydomain.com却提示403错误,www.mydomain.com/index.php这样手动添加index.php后可以正常解析,有遇到类似问题的吗?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

全局加上

index index.php

server {
        listen       88;
        server_name  test.test.com;

        charset utf-8;

        index index.php # 全局

以下的配置我就不写了


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...