Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author imaguard

    (@imaguard)

    Hi,

    The plugin is written for apache servers, and the htaccess files will have to be converted to work on Nginx servers.

    You should be able to just copy the file into a converter like this

    https://winginx.com/htaccess

    And paste it into you nginx configuration instructions (nginx doesn’t use htaccess files at all).

    I have NOT tested this, so don’t kill me if it screws up something ??

    Plugin Author imaguard

    (@imaguard)

    Marking this topic as resolved, but just let us know if you still have any questions and we will assist as best we can.

    Thread Starter popac

    (@popac)

    Hi, I’m back with first results…

    for converting .htaccess to nginx I use

    https://www.anilcetin.com/

    This converter is much better.

    After converting htacces file I get this:

    if ($http_referer !~* "^https://(.+.)?websitename.com"){
    	set $rule_0 1$rule_0;
    }
    if ($rule_0 = "1"){
    	rewrite ^/(.*).(jpg|png|jpeg|gif)$ /show-image/?img=/$1.$2 permanent;
    }

    This code need to enter to vhost.conf (if you have multiple websites that use nginx or nginx.conf if you have all website settings in one file ( I hope nginx users will understand).

    Then need to restart nginx service/server:
    nginx -s stop
    and then start again
    nginx

    Firstly I configured plugin to work with option “Show text over image”
    and all worked ok, after that I try solution with redirection and also have good result, just like you write for plugin.

    Need to say that plugin now working much faster compared to the previous versions.

    Remained to see how G search engine responds to 301/302 redirection and how it will work in future (indexing new content, status of old indexed images, position etc). I will write here my results.

    Thread Starter popac

    (@popac)

    I have problem with Dedicated Server overload
    Error message:

    WordPress database error MySQL server has gone away for query SELECT option_value FROM wpdatabase_options WHERE option_name = ‘pt_body_color’ LIMIT 1 made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/mytheme1/404.php’), get_header, locate_template, load_template, require_once(‘/themes/mytheme1/header.php’), get_settings, get_option

    etc etc…

    error dump rapidly increasing

    Plugin Author imaguard

    (@imaguard)

    First of all: thanks for sharing your experiences with implementing Imaguard on a nginx server!

    As for your server errors: This is very odd. The error doesn’t seem to be related to Imaguard. I have no experience with Nginx servers. Is it possible to trace it back to a page called by the user? F ex if the page that caused the error was originally f ex yourblog.com/show-image ?

    Thread Starter popac

    (@popac)

    Interesting is that error going from file to file :

    i wrote here: WHERE option_name = ‘pt_body_color’

    but next errors are:

    WHERE option_name = ‘jwplayermodule_uninstalled’
    WHERE option_name = ‘theme_switched’
    WHERE post_name IN (‘show-image’)..
    etc etc…

    I will try again later, now is not good time for testing on live website ??

    Plugin Author imaguard

    (@imaguard)

    No, that’s probably not a good idea!

    Oddly enough the queries giving the error seems completely straight forward:

    SELECT option_value FROM wpdatabase_options WHERE option_name = 'pt_body_color' LIMIT 1

    I presume if you run that query manually (f ex with phpmyadmin) it would perform normally. If so there must be an access problem somewhere.

    Hello there!
    I don’t know if I’m doing it correctly. I’m using NGINX too. So I edited my vhost config file located in ‘/etc/nginx/sites-enabled/wordpress’ this way:

    location / {
            try_files $uri $uri/ /index.php?$args;
            # Imaguard:
            if ($http_referer !~* "^https://(.+.)?my-domain.com"){
              set $rule_0 1$rule_0;
            }
            if ($rule_0 = "1"){
              rewrite ^/(.*).(jpg|png|jpeg|gif)$ /show-image/?img=/$1$
            }
        }

    but I’m not seeing any watermarking in the Google Images search results. When I point my browser to https://www.my-domain.com/wp-content/uploads/2013/05/images.jpg?test’ I get an 404 error, what is supposed, right? Also, when I click on a result in the Google Images search, it redirects me to the post where the image appears. So I think that everything is working properly but the watermarking. Any clue of what I’m missing?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘nginx’ is closed to new replies.