Title: server configuration error
Last modified: September 18, 2020

---

# server configuration error

 *  Resolved [keniry](https://wordpress.org/support/users/keniry/)
 * (@keniry)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/)
 * Hello, I hope you can help as I want to use your plugin on my spinupwp servers
   which run nginx.
 * my test site is [https://astrabb.mull.pro](https://astrabb.mull.pro)
 * currently I cannot get past the `server configuration error Redirects on your
   server are not working.`
 * As I am fairly useless with nginx or apache for that matter I checked with spinupwp
   support and sent your FAQ nginx config link.
 * The comment was…
 * > Based on a quick view of the link you’ve sent I would recommend adding a new.
   > conf file to the following directory:
   > /etc/nginx/sites-available/{domain}/server/webp.conf (or whatever you’d like
   > to name the file besides webp)
   > This will get imported into the sites server block in the main nginx conf.
 * They added that they do not normally support this sort of custom change so I 
   am hoping we can arrive at another solution.
 * anyway I created like this
 *     ```
       $ cat /etc/nginx/sites-available/astrabb.mull.pro/server/webp.conf
        location ~ /wp-content/uploads/(?<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;
           } 
       ```
   
 * mime.types
 *     ```
       $ cat /etc/nginx/mime.types
   
       /../
           image/png                             png;
           image/tiff                            tif tiff;
           image/vnd.wap.wbmp                    wbmp;
           image/x-icon                          ico;
           image/x-jng                           jng;
           image/x-ms-bmp                        bmp;
           image/svg+xml                         svg svgz;
           image/webp                            webp;
       ```
   
 * I also tried the latest beta plugin 1.4.3 indicated in the recent post on not
   installing htaccess for nginx.
 * [https://spinupwp.com/doc/changing-nginx-settings/](https://spinupwp.com/doc/changing-nginx-settings/)
   might give you some idea but I ran up a server purely to test your plugin – its
   all test nothing live
 * …rather than fill this forum I can send you anything you need.
 * thanks
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fserver-configuration-error-12%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/server-configuration-error-12/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/server-configuration-error-12/page/2/?output_format=md)

 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13423322)
 * Hi [@keniry](https://wordpress.org/support/users/keniry/),
 * Thanks for your message.
 * Please see the [plugin’s FAQ](https://wordpress.org/plugins/webp-converter-for-media/faq/).
   There you will find the correct configuration for the Nginx server. Your configuration
   is out of date.
 *  Thread Starter [keniry](https://wordpress.org/support/users/keniry/)
 * (@keniry)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13423833)
 * i read the faq
 *  Thread Starter [keniry](https://wordpress.org/support/users/keniry/)
 * (@keniry)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13423856)
 * Have you heard of specific hyperlinks – they can be useful here,
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13428285)
 * [@keniry](https://wordpress.org/support/users/keniry/) read my message again.
   I gave you a solution to your problem:
 * > Please see the [plugin’s FAQ](https://wordpress.org/plugins/webp-converter-for-media/faq/).
   > There you will find the correct configuration for the Nginx server. Your configuration
   > is out of date.
 *  Thread Starter [keniry](https://wordpress.org/support/users/keniry/)
 * (@keniry)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13428652)
 * [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/) Dear
   Mateusz, thank you so much for sending a such a thoughtful detailed and specific
   solution _configuration is out of date _ but alas I have no idea what you mean
   by my since it was copy and pasted from the FAQ link you often paste into this
   forum.
 * As explained previously I am not a nginx expert but I did read the FAQ over and
   over again and I raised a ticket with my host support who explained in detail
   as I previously typed:
 * > Based on a quick view of the link you’ve sent I would recommend adding a new.
   > conf file to the following directory:
   > /etc/nginx/sites-available/{domain}/server/webp.conf (or whatever you’d like
   > to name the file besides webp)
   > This will get imported into the sites server block in the main nginx conf.
 * So I followed your FAQ and their advice I added your sample server directive 
   block from the FAQ but as you would probably guess if I include the server directive
 * `$ sudo nginx -t
    nginx: [emerg] “server” directive is not allowed here in /etc/
   nginx/sites-available/astrabb.mull.pro/server/webp.conf:1
 * so I removed the server outer block and I get no error nginx starts OK but the
   original dashboard error message remains:
 * > Redirects on your server are not working.
 * thank you
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13428657)
 * Please compare your configuration in the first post with the one now in the FAQ.
   Do you see the difference?
 *  Thread Starter [keniry](https://wordpress.org/support/users/keniry/)
 * (@keniry)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13428714)
 * yes
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13429680)
 * Then you know what to improve 🙂
 *  Thread Starter [keniry](https://wordpress.org/support/users/keniry/)
 * (@keniry)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13430785)
 * I tried this plugin on two server platforms, easywp and spinupwp; in both cases
   I could not get past the admin dashboard error.
 * `server configuration error Redirects on your server are not working.`
 * I dont think there is anything too special in the way my server is configured
   but I followed the FAQ and as suggested in the FAQ got sysadmin advice which 
   was
 * > Based on a quick view of the link you’ve sent I would recommend adding a new.
   > conf file to the following directory:
   > /etc/nginx/sites-available/{domain}/server/webp.conf (or whatever you’d like
   > to name the file besides webp)
   > This will get imported into the sites server block in the main nginx conf.
 *  
 * I checked the two config points mentioned the FAQ for this plugin and found mime.
   types to have already defined of webp but lacking the server / location directive.
   as I dont know much about nginx configuration and I have a test server I tried
   a few things
 * adding the nginx config block as per the FAQ as of sept 21 2020 to a new file/
   etc/nginx/sites-available/{domain}/server/webp.conf
 * FAQ code block
 *     ```
       server {
       # 
   
       location ~ /wp-content/(?.+)\.(?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;
       }
       }
       ```
   
 * …in a new file as suggested by my support will result in/etc/nginx/sites-available/{
   domain}/server/webp.conf
 * after killing nginx the first time I learnt its best to run this first and on
   a test server
 * `$ sudo nginx -t`
    `nginx: [emerg] “server” directive is not allowed here in /
   etc/nginx/sites-available`
 * I found some explanation of that here:
 * [https://stackoverflow.com/questions/41766195/nginx-emerg-server-directive-is-not-allowed-here/41766811](https://stackoverflow.com/questions/41766195/nginx-emerg-server-directive-is-not-allowed-here/41766811)
 * I tried whats seems to be an OLD VERSION from the forum with had the server directive
   removed
 *     ```
       location ~ /wp-content/uploads/(?<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;
           } 
       ```
   
 * then the NEW VERSION from the FAQ with server directive removed
 *     ```
        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;
         }
       ```
   
 * both versions pass nginx -t but neither remove the dashboard error message
 * `server configuration error Redirects on your server are not working`
 * I leave it there as reading further CDN seems to be not supported by this plugin.
   I hope somene finds this useful.
 * update: the code block segments in this post are tricky to format – trying again
    -  This reply was modified 5 years, 8 months ago by [keniry](https://wordpress.org/support/users/keniry/).
    -  This reply was modified 5 years, 8 months ago by [keniry](https://wordpress.org/support/users/keniry/).
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13432321)
 * [@keniry](https://wordpress.org/support/users/keniry/) If you want, add the following
   code to the functions.php file in your theme:
 *     ```
       add_filter('webpc_server_errors', function($errors)
       {
         if (isset($errors['rewrites_not_working'])) {
           unset($errors['rewrites_not_working']);
         }
         return $errors;
       });
       ```
   
 * This will hide this error. Then check the plugin operation.
 *  Thread Starter [keniry](https://wordpress.org/support/users/keniry/)
 * (@keniry)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13432783)
 * [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/) sorry
   I don’t have a lot of time today but I quickly checked the nginx config again;
   I added the code using the code snippets plugin.. which did see the error message
   go away and allow the force convert all images to run using the beta plugin Version
   1.4.2 – it seemed to run but I suspect it has an issue as I got this message 
   for about 61 of 93 media items plus I cant see any evidence of serving webp
 * /sites/astrabb.mull.pro/files//wp-content/uploads/2020/09/dd5640d2-a126-310d-
   9cf5-33587b301a42.png” converted to WebP is larger than original and has been
   deleted.
 * the debug log is here
    [https://www.dropbox.com/s/714rzd2vogcpklm/debug.log?dl=0](https://www.dropbox.com/s/714rzd2vogcpklm/debug.log?dl=0)
 * Nothing sensitive in there as its a test system but I will remove the file after
   you say you have seen it.
 * I can look at this more carefully in a day or two if you want.
    -  This reply was modified 5 years, 8 months ago by [keniry](https://wordpress.org/support/users/keniry/).
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13432832)
 * [@keniry](https://wordpress.org/support/users/keniry/) I have one big request
   for you – please read the full description of the plugin once. There you will
   find answers to your questions.
 * I checked that the following image was converted to WebP:
    - original: [https://astrabb.mull.pro/wp-content/uploads/2020/09/pexels-clem-onojeghuo-175773.jpg](https://astrabb.mull.pro/wp-content/uploads/2020/09/pexels-clem-onojeghuo-175773.jpg)
    - converted to WebP: [https://astrabb.mull.pro/wp-content/uploads-webpc/uploads/2020/09/pexels-clem-onojeghuo-175773.jpg.webp](https://astrabb.mull.pro/wp-content/uploads-webpc/uploads/2020/09/pexels-clem-onojeghuo-175773.jpg.webp)
 * And yet the original is loaded. Check it out [here](https://i.ibb.co/BrW9Pns/Bez-tytu-u.png).
   This means that your Nginx configuration was wrong and the plugin will not work
   properly. The plugin intentionally displays some errors to inform the user about
   it.
 * Everything is described in [the FAQ](https://wordpress.org/plugins/webp-converter-for-media/faq/).
 *  Thread Starter [keniry](https://wordpress.org/support/users/keniry/)
 * (@keniry)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13436606)
 * [@mateuszgbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * > There you will find answers to your questions.
 * I do not have any questions, the plugin does not work with my config, I spent
   many hours and supplied and did what you asked and you just keep referring me
   back to non specific sections of the Description and FAQ like I am a naughty 
   student who didn’t my the homework. Did I miss something ? probably – am I willing
   to look or help anymore. No. Good luck with your plugin it’s a nice idea …I imagine.
 *  [thangdgm](https://wordpress.org/support/users/thangdgm/)
 * (@thangdgm)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13437250)
 * I also got the same error and couldn’t fix it, if I add the code to the function
   then it works.
 *  Plugin Author [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * (@mateuszgbiorczyk)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/#post-13437527)
 * [@keniry](https://wordpress.org/support/users/keniry/) Please forgive me, but
   I am not able to help everyone with server configuration. By providing you with
   the plugin, I inform you what is not working by displaying the error.
 * In the FAQ plugin is a sample configuration for Nginx, he personally tested. 
   If your server is specific and requires a different configuration, you must take
   care of it on your own. The number of possible server configurations is huge.
   Only the administrator of a given server knows it fully. I gave an example for
   a basic Nginx setup that works. Adjust it to your needs.
 * I am not able to spend many hours configuring the server for each person separately.
   That’s why I created a FAQ that answers most questions. If there was a problem
   in the plug, many people would report problems, looking at the number of active
   installations, and it is less than a percentage of all users.

Viewing 15 replies - 1 through 15 (of 18 total)

1 [2](https://wordpress.org/support/topic/server-configuration-error-12/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/server-configuration-error-12/page/2/?output_format=md)

The topic ‘server configuration error’ is closed to new replies.

 * ![](https://ps.w.org/webp-converter-for-media/assets/icon-256x256.png?rev=2636288)
 * [Converter for Media - Optimize images | Convert WebP & AVIF](https://wordpress.org/plugins/webp-converter-for-media/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/webp-converter-for-media/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/webp-converter-for-media/)
 * [Active Topics](https://wordpress.org/support/plugin/webp-converter-for-media/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/webp-converter-for-media/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/webp-converter-for-media/reviews/)

 * 18 replies
 * 3 participants
 * Last reply from: [Mateusz Gbiorczyk](https://wordpress.org/support/users/mateuszgbiorczyk/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/server-configuration-error-12/page/2/#post-13440926)
 * Status: resolved