I have a working Nginx config for a static HTML site. I need to add a forum at http://blah.com/forum, php-fpm is installed and working as a unix socket (I have tested and got this working via a test sub domain). But I can't get /forum to work, could someone post a working php-fpm config that will work in a sub dir?

Currently my site resides at /usr/share/nginx/html/ and my forum will be /usr/share/nginx/html/forum



You need to tell your Nginx to fastcgi_pass the forum requests to your PHP backend. That's an example:

location /forum {
    root /usr/share/nginx/html/forum;
    include /etc/nginx/fastcgi_params;
    fastcgi_index index.php;
    fastcgi_pass unix:/tmp/php-fpm.socket;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.