# Making Wordpress Plugins Work With Nginx

**URL:** <https://www.ruby-forum.com/t/making-wordpress-plugins-work-with-nginx/211889>\
**Category:** NGINX\
**Created:** [September 16, 2011, 4:42am UTC](https://www.ruby-forum.com/t/making-wordpress-plugins-work-with-nginx/211889 "2011-09-16T04:42:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [September 16, 2011, 4:42am UTC](https://www.ruby-forum.com/t/making-wordpress-plugins-work-with-nginx/211889/1 "2011-09-16T04:42:01Z")

</div>

I’m new to Nginx (Moving from Apache). I’m having a problem where the  
majority of Wordpress plugin are not working. I’m using Nginx 1.1.3.

Here are my configuration if it can help figuring out the problem

#####nginx.conf  
user www-data;  
worker\_processes 1;

error\_log /var/log/nginx/error.log;  
pid /var/run/nginx.pid;

events {  
worker\_connections 1024;  
# multi\_accept on;  
}

http {  
include /etc/nginx/mime.types;

```
access_log /var/log/nginx/access.log;

sendfile on;
#tcp_nopush on;

#keepalive_timeout 0;
keepalive_timeout 65;
tcp_nodelay on;

gzip on;
gzip_disable "MSIE [1-6]\.(?!.*SV1)";

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;

```

}

####sites-available/mydomain.com

server {  
listen 80;  
server\_name [mydomain.com](http://mydomain.com);

```
    access_log /var/log/nginx/mydomain.com.access.log;
    root /var/www/mydomain;
    index index.php;

    location / {
            try_files $uri $uri/ @wordpress;
    }

    location @wordpress {
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_param SCRIPT_FILENAME

```

/var/www/mydomain/index.php;  
include /etc/nginx/fastcgi\_params;  
fastcgi\_param SCRIPT\_NAME /index.php;  
}

```
    location ~ \.php$ {
            try_files $uri @wordpress;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME

```

/var/www/mydomain$fastcgi\_script\_name;  
include fastcgi\_params;

Thanks

Posted at Nginx Forum:

> **[Making Wordpress Plugins Work With Nginx](https://forum.nginx.org/read.php?2,215277,215277#msg-215277)**
>
> I'm new to Nginx (Moving from Apache). I'm having a problem where the majority of Wordpress plugin are not working. I'm using Nginx 1.1.3. Here are my configuration if it can help figuring out the problem #####nginx.conf user www-data;...

---

<div class="post-metadata">

**Author:** ![damnlinux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@damnlinux](https://www.ruby-forum.com/u/damnlinux)\
**Post date:** [September 16, 2011, 1:35pm UTC](https://www.ruby-forum.com/t/making-wordpress-plugins-work-with-nginx/211889/2 "2011-09-16T13:35:36Z")

</div>

Hi,

Nginx does not embed PHP into its own process like Apache does, this  
mean that Nginx has no effect on the execution of PHP and if word press  
plugins do not work then it’s either due to the plugins relying on  
Apache via mod\_rewrite or because you have misconfigured PHP.

If it’s a mod\_rewrite problem then we can potentially help, but we’ll  
need to know what it expects from .htaccess, if it’s the latter then  
this is probably the wrong mailing list.

Posted at Nginx Forum:

> **[Re: Making Wordpress Plugins Work With Nginx](https://forum.nginx.org/read.php?2,215277,215295#msg-215295)**
>
> I'm new to Nginx (Moving from Apache). I'm having a problem where the majority of Wordpress plugin are not working. I'm using Nginx 1.1.3. Here are my configuration if it can help figuring out the problem #####nginx.conf user www-data;...

---

<div class="post-metadata">

**Author:** ![damnlinux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@damnlinux](https://www.ruby-forum.com/u/damnlinux)\
**Post date:** [September 17, 2011, 2:25am UTC](https://www.ruby-forum.com/t/making-wordpress-plugins-work-with-nginx/211889/3 "2011-09-17T02:25:26Z")

</div>

Thank you Ensiferous.

I don’t think it’s a PHP issue because Wordpress itself works fine it is  
quite possible though that it’s a mod\_rewrite issue. I’m not familiar  
with Nginx access rewrite my .htaccess is really basic

# BEGIN WordPress
RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST\_FILENAME} !-f RewriteCond %{REQUEST\_FILENAME} !-d RewriteRule . /index.php [L]
# END WordPress

RewriteEngine On  
RewriteCond %{HTTP\_REFERER} !^http://(www.)?mydomain.com/ [NC]  
RewriteCond %{HTTP\_REFERER} ^http:// [NC]  
RewriteCond %{HTTP\_REFERER} !^$  
RewriteRule .(jpe?g|gif|png)$ - [F]

Thanks again for the help

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,215277,215319#msg-215319](http://forum.nginx.org/read.php?2,215277,215319#msg-215319)

---

<div class="post-metadata">

**Author:** ![damnlinux](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c2a13f/32.png) [@damnlinux](https://www.ruby-forum.com/u/damnlinux)\
**Post date:** [September 17, 2011, 6:01am UTC](https://www.ruby-forum.com/t/making-wordpress-plugins-work-with-nginx/211889/4 "2011-09-17T06:01:12Z")

</div>

> **[nginx Compatibility](https://wordpress.org/plugins/nginx-compatibility/)**
>
> The plugin makes WordPress more friendly to nginx.

try installing this plugin when WP detects nginx and “not compilant”  
SAPI it assumes that rewrite is impossible and turns it off,  
this plugins works around that problem. (but do not use it with Apache  
if you move your WP somewhere else later)

~ cheers

Posted at Nginx Forum:

> **[Re: Making Wordpress Plugins Work With Nginx](https://forum.nginx.org/read.php?2,215277,215320#msg-215320)**
>
> I'm new to Nginx (Moving from Apache). I'm having a problem where the majority of Wordpress plugin are not working. I'm using Nginx 1.1.3. Here are my configuration if it can help figuring out the problem #####nginx.conf user www-data;...
