dongzen7263 2016-01-20 20:13
浏览 102

Laravel / Nginx服务错误的网站

I have tried everything.

I recently tried to deploy a new Laravel application on my Ubuntu Digital Ocean droplet. I have done this many times in the past and have done nothing out of the ordinary with this project. I'm using https://gist.github.com/jamieshepherd/50419bb148a4f43e8266 this as a template nginx configuration, which I base all of my sites off. However, this time I deployed and went to my domain, I was served another client's site. The site had no images, styles, scripts etc. - but sure enough this was the wrong site. Weirdly, I could go to /images/example.jpg and get the correct file which would be in /public/images/example.jpg - but the actual routes were being served from a completely different folder.

There is absolutely no reference to the other client in my project anywhere, I feel like it has something to do with Laravel or PHP5-FPM setting some kind of root directory to the other folder.

I have gone to /public/index.php and just echo and died a message, and this works fine. When I revert the change and let the application run it again displays the other client's application. Here's a list of other things I've tried.

  • Temporarily renaming the other client's folder, as expected, NewSite throws a 404 error
  • Temporarily disabling the other client's nginx block, NewSite continues to serve the other client's site (remember, not css/images/scripts, weirdly)
  • Reinstalling PHP5-FPM
  • Printing the document_root, everything looks normal (/web/NewSite/public)
  • Trying to run the site off a different port
  • Pulled a working Laravel application from a completely different server, put it on this server, set the domain to point to this working application, serves the other client's site
  • Grep'd for any references to the client site in any of the project folders just to check I wasn't going insane, confirmed I'm not insane, though after all this I'm not sure anymore

Really I'm lost, I have no idea how to debug this any more.

Site trying to deploy: http://paragon.gg

Client site view that it's servring: https://swellhunter.co.uk

Client site NGINX conf: https://gist.github.com/jamieshepherd/4ff5430ddb13ed04f22c

Edit: Update: To make matters even more bizarre. I have temporarily removed swellhunter from sites-enabled, visited paragon.gg, still serves swellhunter's index. WHAT? There is absolutely no reference to the site at all now, I've even moved the paragongg folder to a completely different place to check. How on earth is it even finding the view with no reference to go on?

  • 写回答

2条回答 默认 最新

  • dongtan7351 2016-01-20 20:20
    关注

    Seems like an issue with Laravel rather than with nginx or with your VPS. Since you pointed out simple PHP file is pointing out rightly. SSH to your droplet and run you laravel app using php artisan serve. And access your droplet on port:3000 If the problem persists you can rule out server issues and can concentrate on debugging laravel app. Maybe be there is something wrong with you laravel app itself, some unwanted changes etc. Did you verify your laravel App?

    评论

报告相同问题?

悬赏问题

  • ¥15 运筹学中在线排序的时间在线排序的在线LPT算法
  • ¥30 求一段fortran代码用IVF编译运行的结果
  • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
  • ¥15 lammps拉伸应力应变曲线分析
  • ¥15 C++ 头文件/宏冲突问题解决
  • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
  • ¥50 安卓adb backup备份子用户应用数据失败
  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试,帮帮忙吧