• Resolved jb13

    (@jb13)


    Hello,

    I have a VPS with Nginx (configured with Wordops).
    I tried to follow your “Configuration for Nginx” on your FAQ, but it crashes my Nginx configuration.

    I tried several times before submitting this ticket, but always the same thing :

    Testing Nginx configuration [KO]
    Start : php7.3-fpm[OK]
    Start : fail2ban [OK]
    Start : netdata [OK]

    I can’t submit screenshots, I do not know what could be useful for you.

    Thank you for your help,

    Jean

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @jb13,

    Thank you for your message.

    The configuration listed in the FAQ is correct and has been tested.

    Thread Starter jb13

    (@jb13)

    Hi Mateusz,

    Thank you for your reply.
    I tried with this simplest code instead of your, and had no issue that time.
    But do you think it works too ?

    location ~* ^.+\.(png|jpe?g)$ {
    add_header Vary Accept;
    try_files $uri$webp_suffix $uri =404;
    }

    Thanks again,

    JB

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @jb13 I think it is not enough. Only the configuration in the FAQ has been tested by me.

    I checked my configuration for the Nginx server. I set up a new server and did the entire procedure using these instructions. I was able to run WordPress and installed my plugin.

    Then I received a error message in plugin settings that redirects are not working. This is normal as Nginx requires manual configuration. Then I did the configuration settings for the plugin and everything works. The error is gone and the images are displayed in WebP.

    Thread Starter jb13

    (@jb13)

    I’ll check your link this weekend.
    On the plugin are you using pass Thru or .htaccess ? :

    via .htaccess (recommended)
    Pass Thru (without rewrites in .htacces files or Nginx configuration)

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    In my test, I used the via .htaccess method. When using the Pass Thru method, you don’t need to configure anything about redirects.

    Thread Starter jb13

    (@jb13)

    Hi Mateusz,

    First of all happy new year.

    I finally been able to wrote your code properly and had this message when restarting nginx :

    Testing Nginx configuration [OK]
    Starting Nginx [OK]
    Start : php7.3-fpm[OK]
    Start : fail2ban [OK]
    Start : netdata [OK]

    So everything should be working, right ?

    But I still have the message on the plugin page :

    Server configuration error
    Redirects on your server are not working. Check the correct configuration for you in the plugin FAQ. If your configuration is correct, it means that your server does not support redirects from the .htaccess file or requests to images are processed by your server bypassing Apache.

    In this case, please contact your server administrator.

    Also try changing option “Image loading mode” to a different one. Issues about rewrites can often be resolved by setting this option to “Pass Thru”. You can do this in plugin settings below. After changing settings, remember to flush cache if you use caching plugin or caching via hosting.

    Error codes: rewrites_not_working

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @jb13 Also all the best for the new year.

    Unfortunately, this configuration has probably been implemented incorrectly or your server has a different configuration. I tested these settings on a clean Nginx server and it works. I have no idea why it doesn’t work for you.

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @jb13 Please send me the contents of the files where you pasted the configuration described in the plugin FAQ. Enter the path to the file and its contents.

    Thread Starter jb13

    (@jb13)

    Should I send it right here ? or to an email address ?

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    You can find my e-mail address on my website. I don’t want to give it here.

    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @jb13 Thank you for your message. Unfortunately, I still don’t know why it doesn’t work.

    Have you tested the Pass Thru mode?

    I’m have the same issue getting this working with wordops. Not sure if it’s a path issue. Here is my nginx config. I tested with the script at the beginning as well. jpgs are still not being server either way. Thanks.

    server {
    
        server_name hw.coach www.hw.coach;
    
        access_log /var/log/nginx/hw.coach.access.log rt_cache;
        error_log /var/log/nginx/hw.coach.error.log;
    
        root /var/www/hw.coach/htdocs;
    
        index index.php index.html index.htm;
    
        include common/wpfc-php74.conf;
    
        include common/wpcommon-php74.conf;
        include common/locations-wo.conf;
        include /var/www/hw.coach/conf/nginx/*.conf;
    
        # https://wordpress.org/plugins/webp-converter-for-media/#faq
    
        location ~ /wp-content/(?<path>.+)\.(?<ext>jpe?g|png|gif)$ {
            if ($http_accept !~* "image/webp") {
                break;
            }
            add_header Vary Accept;
            expires 365d;
            try_files /wp-content/uploads-webpc/$path.$ext.webp $uri =404;
        }
    }
Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Nginx wp’ is closed to new replies.