Skip to content

moving mini from Apache to Nginx #255

@rjCousineau

Description

@rjCousineau

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions