tempestphp / tempest-framework

The PHP framework that gets out of your way 🌊

Home Page:https://tempest.stitcher.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

routes wont work on nginx

Sam-Mear opened this issue Β· comments

I have migrated my first php site to tempest! (idc its not released yet, its doing a lot better than the mini framework I had originally made for it haha)
However, any route that isnt already in the public folder returns a 404 from nginx. sorry if its just a configuration error on my end, just wanted to know if it was reproducible for anyone else.

@Sam-Mear - Do you have something like the following in your config?

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

@aidan-casey i did not, i have added it and ran systemctl restart nginx.service and it had not fixed it. ill send you over the config file

server {
    listen 80;
    server_name pcpartrank www.pcpartrank;
    root /var/www/html/public;

    index index.html index.htm index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
     }

    location ~ /\.ht {
        deny all;
    }

}

I'm not seeing anything right off the bat that would suggest a problem to me here. Is it possible to run a tree command within your site directory and upload the file tree?

I can try to work on documenting the set up process for Nginx soonℒ️ .

ignoring vendor folder here is the output

.
β”œβ”€β”€ composer.json
β”œβ”€β”€ composer.lock
β”œβ”€β”€ public
β”‚   β”œβ”€β”€ Fonts
β”‚   β”‚   β”œβ”€β”€ Ironstrike.otf
β”‚   β”‚   β”œβ”€β”€ Ironstrike_Bold.otf
β”‚   β”‚   β”œβ”€β”€ Ironstrike_Bold_Italic.otf
β”‚   β”‚   └── Ironstrike_ExtraBold.otf
β”‚   β”œβ”€β”€ Images
β”‚   β”‚   β”œβ”€β”€ Brands
β”‚   β”‚   β”‚   β”œβ”€β”€ amd.png
β”‚   β”‚   β”‚   β”œβ”€β”€ intel.png
β”‚   β”‚   β”‚   β”œβ”€β”€ intelc.png
β”‚   β”‚   β”‚   β”œβ”€β”€ nvidia.png
β”‚   β”‚   β”‚   └── nvidiac.png
β”‚   β”‚   β”œβ”€β”€ CpuGray.png
β”‚   β”‚   β”œβ”€β”€ CpuOrange.png
β”‚   β”‚   β”œβ”€β”€ Cpuvs2.png
β”‚   β”‚   β”œβ”€β”€ Cpuvs2.webp
β”‚   β”‚   β”œβ”€β”€ GpuGray.png
β”‚   β”‚   β”œβ”€β”€ GpuOrange.png
β”‚   β”‚   β”œβ”€β”€ HomeGray.png
β”‚   β”‚   β”œβ”€β”€ HomeOrange.png
β”‚   β”‚   β”œβ”€β”€ Logo.ico
β”‚   β”‚   β”œβ”€β”€ Logo.png
β”‚   β”‚   β”œβ”€β”€ PCPartRank.png
β”‚   β”‚   β”œβ”€β”€ Search
β”‚   β”‚   β”‚   β”œβ”€β”€ Ryzen3.png
β”‚   β”‚   β”‚   β”œβ”€β”€ Ryzen5.png
β”‚   β”‚   β”‚   β”œβ”€β”€ Ryzen7.png
β”‚   β”‚   β”‚   β”œβ”€β”€ Ryzen9.png
β”‚   β”‚   β”‚   β”œβ”€β”€ Thredripper.png
β”‚   β”‚   β”‚   β”œβ”€β”€ default.svg
β”‚   β”‚   β”‚   β”œβ”€β”€ i3.png
β”‚   β”‚   β”‚   β”œβ”€β”€ i5.png
β”‚   β”‚   β”‚   β”œβ”€β”€ i7.png
β”‚   β”‚   β”‚   β”œβ”€β”€ i9.png
β”‚   β”‚   β”‚   β”œβ”€β”€ nvida.png
β”‚   β”‚   β”‚   └── radeon.png
β”‚   β”‚   β”œβ”€β”€ Social
β”‚   β”‚   β”‚   β”œβ”€β”€ Insta.png
β”‚   β”‚   β”‚   β”œβ”€β”€ facebook.png
β”‚   β”‚   β”‚   β”œβ”€β”€ twitter.png
β”‚   β”‚   β”‚   └── yt.png
β”‚   β”‚   β”œβ”€β”€ background.png
β”‚   β”‚   └── webp-test
β”‚   β”‚       β”œβ”€β”€ CpuGray.webp
β”‚   β”‚       β”œβ”€β”€ CpuGray.webpο€ΊZone.Identifier
β”‚   β”‚       β”œβ”€β”€ CpuOrange.webp
β”‚   β”‚       β”œβ”€β”€ CpuOrange.webpο€ΊZone.Identifier
β”‚   β”‚       β”œβ”€β”€ Cpuvs2.webpο€ΊZone.Identifier
β”‚   β”‚       β”œβ”€β”€ GpuGray.webp
β”‚   β”‚       β”œβ”€β”€ GpuGray.webpο€ΊZone.Identifier
β”‚   β”‚       β”œβ”€β”€ GpuOrange.webp
β”‚   β”‚       β”œβ”€β”€ GpuOrange.webpο€ΊZone.Identifier
β”‚   β”‚       β”œβ”€β”€ HomeGray.webp
β”‚   β”‚       β”œβ”€β”€ HomeGray.webpο€ΊZone.Identifier
β”‚   β”‚       β”œβ”€β”€ HomeOrange.webp
β”‚   β”‚       β”œβ”€β”€ HomeOrange.webpο€ΊZone.Identifier
β”‚   β”‚       β”œβ”€β”€ background.webp
β”‚   β”‚       └── background.webpο€ΊZone.Identifier
β”‚   β”œβ”€β”€ Search.css
β”‚   β”œβ”€β”€ index.php
β”‚   β”œβ”€β”€ main.css
β”‚   └── robots.txt
β”œβ”€β”€ sessions
β”‚   β”œβ”€β”€ 0ue7eugqi05db5of07as8p35um
β”‚   β”œβ”€β”€ 6fnar1ooum6d987f8gilahkvom
β”‚   β”œβ”€β”€ cgkmjffoqbvu7errl2c577porn
β”‚   β”œβ”€β”€ k819ci2m0hc4haafgho7iuv73k
β”‚   └── peuq97fkbj3t2mlkhgchegs10s
β”œβ”€β”€ src
β”‚   β”œβ”€β”€ Code
β”‚   β”‚   β”œβ”€β”€ Controllers
β”‚   β”‚   β”‚   β”œβ”€β”€ MainController.php
β”‚   β”‚   β”‚   └── SubController.php
β”‚   β”‚   └── ViewModels
β”‚   β”‚       β”œβ”€β”€ HomeView.php
β”‚   β”‚       └── SearchView.php
β”‚   β”œβ”€β”€ Data
β”‚   β”‚   β”œβ”€β”€ Backup
β”‚   β”‚   β”‚   β”œβ”€β”€ CPU_UserBenchmarks.csv
β”‚   β”‚   β”‚   └── GPU_UserBenchmarks.csv
β”‚   β”‚   β”œβ”€β”€ CPU_UserBenchmarks.csv
β”‚   β”‚   β”œβ”€β”€ GPU_UserBenchmarks.csv
β”‚   β”‚   β”œβ”€β”€ cpu-benchmark.csv
β”‚   β”‚   β”œβ”€β”€ download.php
β”‚   β”‚   β”œβ”€β”€ error_log
β”‚   β”‚   └── specs.js
β”‚   └── Design
β”‚       β”œβ”€β”€ Views
β”‚       β”‚   β”œβ”€β”€ Components
β”‚       β”‚   β”‚   β”œβ”€β”€ cpu-ranking.view.php
β”‚       β”‚   β”‚   └── gpu-ranking.view.php
β”‚       β”‚   β”œβ”€β”€ Errors
β”‚       β”‚   β”‚   └── 404.view.php
β”‚       β”‚   β”œβ”€β”€ Search
β”‚       β”‚   β”‚   β”œβ”€β”€ found.view.php
β”‚       β”‚   β”‚   β”œβ”€β”€ no-search.view.php
β”‚       β”‚   β”‚   └── not-found.view.php
β”‚       β”‚   β”œβ”€β”€ base.php
β”‚       β”‚   β”œβ”€β”€ cpu.view.php
β”‚       β”‚   β”œβ”€β”€ gpu.view.php
β”‚       β”‚   β”œβ”€β”€ home.view.php
β”‚       β”‚   β”œβ”€β”€ privacy.view.php
β”‚       β”‚   β”œβ”€β”€ roadmap.view.php
β”‚       β”‚   β”œβ”€β”€ search.view.php
β”‚       β”‚   └── terms.view.php
β”‚       └── css
β”‚           └── main.css
└── tempest

20 directories, 91 files

@Sam-Mear - I looked at this with a fresh set of eyes today and found the issue. πŸ˜…

You are adding =404 to the snippet I sent you which will always fallback to a 404 response if the file doesn't exist. You need to ensure your location block looks exactly like so:

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

Thanks so much!

PCPartRank currently on tempest now!