• Hello,

    I changed my hosting company, they use Nginx webserver. So .htaccess file in no valid anymore. Where I can find or generate the “Server Config Rules” for Nginx? to add it to the nginx.conf file.

    Thank you

Viewing 8 replies - 1 through 8 (of 8 total)
  • @marko6548

    The iTSec plugin will automatically detect your web server config type and generate rules accordingly. For Nginx the rules are by default saved into a nginx.conf file (which replaces the .htaccess file as used by Apache).
    You must include that file into the main nginx.conf configuration file of the server.

    Thread Starter Marko6548

    (@marko6548)

    Thank you,

    I migrate from Apache to Nginx, so old setting also. When I click in iTheme>Advanced>Server Config Rules, it shows me setting for .htaccess.

    Where is the nginx.conf generated by default stored?

    @marko6548

    You need to deactivate the iTSec plugin and then reactivate it.
    This way the server config rules are regenerated and when running on Nginx saved in a nginx.conf file which is located in the WordPress root folder. Simply delete any old .htaccess file.

    Note that you must make sure you are using the latest iTSec plugin release (6.2.1).
    A bug existed with regenerating the server config rules which was fixed recently.

    According to the iTSec plugin 6.2.0 changelog:

    Bug Fix: Modifications to wp-config.php, .htaccess, and nginx.conf files are now properly re-added upon reactivation.

    Thread Starter Marko6548

    (@marko6548)

    Thank you for you help,

    It help me one step. I removed htaccess file, deactivate and reactivate. Then try to save settings. Itheme now recognized that it is Nginx server but gave me error as he is trying to save the file to a path used on my old hosting.And it should use new path on my new hosting

    (” The file path supplied in NGINX Conf File cannot be used as the parent directory cannot be created. The directory /home/zven12/public_html could not be created due to an unknown error. This could be due to a permissions issue.

    The directory supplied in Path to Log Files cannot be used as a valid directory. The directory /home/zven12/public_html/wp-content/uploads/ithemes-security/logs could not be created due to an unknown error. This could be due to a permissions issue.

    The settings could not be saved. Please correct the errors above and try again.”)

    How to tell iTheme of new server path?

    Cheers

    @marko6548

    Ah, right I see.

    Simply navigate to the Global Settings module, click on the “Configure Settings” button and then set the correct path for both the “NGINX Conf File” and “Path to Log Files” settings.

    Thread Starter Marko6548

    (@marko6548)

    Thank you very much indeed,

    All done, path changed successfully, Nginx conf file created, BUT it is blank 0 KB.
    I checked the folder all Read/Write rights allowed to the folder.

    Also I tried to save settings again. But nginx.conf still has zero size.

    @marko6548

    Are there any Nginx specific rules visible in the (Advanced) Server Config Rules module ?

    Do make sure the Write to Files setting in the Global Settings module is enabled.

    You could try and deactivate/reactivate the iTSec plugin.

    Another thing to try is to actually change a setting that writes server config rules and then save settings. Not all settings generate server config rules.

    Most of the System Tweaks module settings generate server config rules.

    Still no luck after all of the above, then there is one option left. Deactivate, and delete the plugin. Then try and reinstall. Do note all old settings will be lost.

    Thread Starter Marko6548

    (@marko6548)

    Thank you, I appreciate your help.

    WORKS like a charm. I deactivate and delete the plugin and reinstalled it again, the nginx.conf file was created. Even I didn’t not lose any setting as it is stored in DB.

    Many thanks again.

    Note for the public: For those who want to move their WordPress hosting from Apache to Nginx server, it is very painful as .htaccess not works in Nginx.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Server Config Rules for Nginx’ is closed to new replies.