33 lines
772 B
Nginx Configuration File
33 lines
772 B
Nginx Configuration File
events {}
|
||
|
||
http {
|
||
include mime.types;
|
||
default_type application/octet-stream;
|
||
|
||
server {
|
||
listen 80;
|
||
server_name localhost;
|
||
|
||
root /var/www/html;
|
||
index index.php;
|
||
|
||
# 1️⃣ Serve static files directly
|
||
location ~* \.(css|js|png|jpg|jpeg|gif|svg|ico|woff|woff2|ttf)$ {
|
||
try_files $uri =404;
|
||
}
|
||
|
||
# 2️⃣ ALL routes → index.php
|
||
location / {
|
||
try_files $uri $uri/ /index.php?$query_string;
|
||
}
|
||
|
||
# 3️⃣ PHP execution
|
||
location ~ \.php$ {
|
||
include fastcgi_params;
|
||
fastcgi_pass 127.0.0.1:9000;
|
||
fastcgi_index index.php;
|
||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||
}
|
||
}
|
||
}
|