Jump to content

Recommended Posts

Posted

While exploring Invision Board's documentation, I noticed a topic that seems to be underrepresented: selecting the right web server engine. At the time of writing this, there was only one brief mention about which server engine to use, and the information was quite limited. Based on this, I decided to configure nGinX.

After browsing through their forums, I stumbled upon a helpful discussion about enabling the API functionality on nGinX. It's worth noting that Invision Board does not officially support nGinX or PHP 8.3, so proceed with caution if you're using these configurations.

If you're running nGinX and want to get the API working, adding the following configuration to your server block should do the trick:

# Add API-specific configuration
location /api/ {
    # Pass the Authorization header to PHP
    set $http_authorization $http_authorization;

    # Serve existing files or route to index.php
    try_files $uri $uri/ /api/index.php;

    # PHP processing for the API
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

        # Pass the HTTP_AUTHORIZATION header to PHP
        fastcgi_param HTTP_AUTHORIZATION $http_authorization;

        include fastcgi_params;
    }
}

Key Points to Remember:

  1. This configuration allows the API to function correctly on nGinX by handling requests and passing the Authorization header properly.
  2. Ensure your PHP-FPM socket path (/var/run/php/php8.3-fpm.sock) matches your server's setup. Adjust it as necessary for your version of PHP or server configuration.
  3. Since Invision Board doesn't officially support nGinX or PHP 8.3, you may encounter issues. Use at your own discretion, and test thoroughly in your environment.

By including this snippet, you should be able to enable API functionality on your nGinX-powered Invision Board installation. If you've run into similar challenges or have alternative configurations, feel free to share your experiences!

CodeName: Jessica

💻 Linux Enthusiast | 🌍 Adventurer | 🦄 Unicorn 
🌐 My Site | 📢 Join the Forum

spacer.png

 

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use Privacy Policy Guidelines We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.