WordPress.org

Forums

NinjaFirewall (WP edition)
[resolved] Nginx instructions (3 posts)

  1. athalas
    Member
    Posted 2 years ago #

    Hi,

    Where would we be able to find the installation instructions when running under Nginx?

    Thanks

    http://wordpress.org/extend/plugins/ninjafirewall/

  2. nintechnet
    Member
    Plugin Author

    Posted 2 years ago #

    Hi,

    You will need to:

    1) copy the PHP INI instructions to a .user.ini located in your WordPress main folder (unless you setup PHP to use another INI name, e.g. php.ini, php5.ini etc).

    2) because nginx does not support .htaccess, copy the .htaccess PHPRC line and add it to your site configuration. Assuming you are using PHP-FPM, you should have something similar too this:

    server {
       listen         80;
       server_name    yourserver.com;
    
       location ~ \.php$ {
          try_files $uri =404;
          fastcgi_pass   unix:/tmp/php-fpm.sock;
          fastcgi_index  index.php;
          fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
          include        fastcgi_params;
    
          # Add NinjaFirewall PHPRC here :
          fastcgi_param PHPRC /full/path/to/your/.user.ini
       }
    }

    Test your nginx config to ensure the syntax is OK:
    nginx -t
    Then restart nginx.

    You may need to restart PHP-FPM too.

  3. athalas
    Member
    Posted 2 years ago #

    Thanks for the prompt reply. I've added my side and appears to be working.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • NinjaFirewall (WP edition)
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic