大神!大神!!访问.php返回404???!!!

jip0303 2018-03-06 04:31:22
ubuntu 16
nginx 1.10
配置了两个站点(顶级域名和其二级域名) 都是80端口 配置文件除了域名和root以外都一样
顶级域名 为default_server 站点一切正常
二级域名站点 请求.html文件没问题 请求.php文件 服务器返回404 not found


why???
...全文
382 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
jip0303 2018-03-09
  • 打赏
  • 举报
回复
引用 4 楼 jam00 的回复:
/var/www/html/xiaogame.php 检查文件是否存在
在的
果酱很好吃 2018-03-07
  • 打赏
  • 举报
回复
/var/www/html/xiaogame.php 检查文件是否存在
jip0303 2018-03-06
  • 打赏
  • 举报
回复
引用 1 楼 jam00 的回复:
你得把配置文件发出来吧,还有访问链接(可以隐藏域名)
配置见楼上
jip0303 2018-03-06
  • 打赏
  • 举报
回复
www.uhuaroudma.com uhuaroudma.com root /var/www/html/uhuaroudma/public 这个是没有问题的 eleven.uhuaroudma.com root /var/www/html/ 这个是有问题的 访问 域名/xiaogame.php 下面是default_server的配置,另一个配置相同,只是域名、根目录不同和去掉default_server 关键字 server { listen 80 default_server; listen [::]:80 default_server; # SSL configuration # # listen 443 ssl default_server; # listen [::]:443 ssl default_server; # # Note: You should disable gzip for SSL traffic. # See: https://bugs.debian.org/773332 # # Read up on ssl_ciphers to ensure a secure configuration. # See: https://bugs.debian.org/765782 # # Self signed certs generated by the ssl-cert package # Don't use them in a production server! # # include snippets/snakeoil.conf; root /var/www/html/uhuaroudma/public; # Add index.php to the list if you are using PHP index index.html index.htm index.nginx-debian.html index.php; server_name www.uhuaroudma.com uhuaroudma.com; location / { root /var/www/html/uhuaroudma/public; if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location = /50x.html{ root /var/www/html/uhuaroudma/public; } # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { include snippets/fastcgi-php.conf; # fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; # # With php7.0-cgi alone: # # fastcgi_pass 127.0.0.1:9000; # # With php7.0-fpm: fastcgi_pass unix:/run/php/php7.0-fpm.sock; # fastcgi_index index.php; # include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }
果酱很好吃 2018-03-06
  • 打赏
  • 举报
回复
你得把配置文件发出来吧,还有访问链接(可以隐藏域名)

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧