• Resolved Stefano

    (@stefacchio)


    Hi,

    I enabled rewrite for file optimizer on NGINX and I added into Additional nginx directives on Plesk these config:

    location /_static/ {
            fastcgi_pass unix:/var/run/fastcgi.sock;
            include /etc/nginx/fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root/wp-content/plugins/powered-cache/includes/file-optimizer.php;
    }

    But I get error 404 on file resources…why?

    O.S. Debian 12

    NGINX v1.26.2

    Thanks

    • This topic was modified 1 week, 5 days ago by Stefano.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Mustafa Uysal

    (@m_uysl)

    Hi @stefacchio,

    Please double-check that the paths for location /_static/ are correct. If you’re using Nginx with Apache in proxy mode, you may need to handle rewrites in the .htaccess file rather than in the Nginx configuration. (If I remember correctly, in Plesk environments, Nginx passes dynamic requests to Apache while serving static assets directly.)

    But I get error 404 on file resources…why?

    This is likely due to a configuration issue, as the setup may differ slightly from standard Plesk settings.

    If you don’t feel comfortable adjusting settings, don’t turn on the rewrite option for file optimizer.

    Thread Starter Stefano

    (@stefacchio)

    Hi @m_uysl,

    I’m using NGINX without Apache with standard Plesk config.

    What do you mean with ‘?double-check that the paths for?location /_static/?are correct.’?

    Plugin Author Mustafa Uysal

    (@m_uysl)

    What do you mean with ‘ double-check that the paths for location /_static/ are correct.’?

    I meant fastcgi_pass path “unix:/var/run/fastcgi.sock;” and include path “/etc/nginx/fastcgi_params;” is correct.

    Perhaps Plesk configured to use a port instead unix socket, I don’t know the specs and I can’t provide server management level of support.

    Thread Starter Stefano

    (@stefacchio)

    Oh ok, thank you.

    I will do some test.

    Bye

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.