-
Notifications
You must be signed in to change notification settings - Fork 476
Open
Description
I migrated from Apache to Nginx, and found the provided nginx config example only worked after changing the root from / to /public.
This config worked as well:
server {
server_name servername.devops.local;
listen [::]:80;
listen 80;
access_log /var/log/nginx/servername.devops.local.log;
error_log /var/log/nginx/servername.devops.local.log;
root /var/www/servername/public_html;
location / {
index index.php;
try_files /public/$uri /public/$uri/ /public/index.php?url=$uri;
}
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
AlmaLinux 8.6 (Sky Tiger) Linux 4.18.0-372.16.1.el8_6.x86_64
nginx version: nginx/1.14.1
PHP 8.1.8
I'm posting this as an extension to conversation #55
panique
Metadata
Metadata
Assignees
Labels
No labels