# \_wordpress-cache in server name

**URL:** <https://www.ruby-forum.com/t/wordpress-cache-in-server-name/199899>\
**Category:** NGINX\
**Created:** [December 1, 2010, 4:13am UTC](https://www.ruby-forum.com/t/wordpress-cache-in-server-name/199899 "2010-12-01T04:13:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/77aa72/32.png) [@Dobai-Pataky\_BSSSSl](https://www.ruby-forum.com/u/Dobai-Pataky_BSSSSl)\
**Post date:** [December 1, 2010, 4:13am UTC](https://www.ruby-forum.com/t/wordpress-cache-in-server-name/199899/1 "2010-12-01T04:13:30Z")

</div>

I saw this example for setting up nginx to run wordpress and wp-super  
cache

server\_name \_wordpress-cache [mydomain.com](http://mydomain.com);  
root /var/www/wordpress\_dir;  
server\_name\_in\_redirect off;

Can anyone explain to me what the “\_wordpress-cache” is doing in the  
server name area. Guess I’m trying to wrap my head around new config  
options.

Thanks!

---

<div class="post-metadata">

**Author:** ![Ian\_MSEvans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/7bcc69/32.png) [@Ian\_MSEvans](https://www.ruby-forum.com/u/Ian_MSEvans)\
**Post date:** [December 1, 2010, 12:44pm UTC](https://www.ruby-forum.com/t/wordpress-cache-in-server-name/199899/2 "2010-12-01T12:44:09Z")

</div>

Hi!

Where you saw the example? Can you post the link?

I’m not using that option but hosting thousands of wordpress behind  
nginx so I would like to check it out.

Cheers

Guzman

---

<div class="post-metadata">

**Author:** ![Ian\_MSEvans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/7bcc69/32.png) [@Ian\_MSEvans](https://www.ruby-forum.com/u/Ian_MSEvans)\
**Post date:** [December 1, 2010, 1:50pm UTC](https://www.ruby-forum.com/t/wordpress-cache-in-server-name/199899/3 "2010-12-01T13:50:40Z")

</div>

## Ian M. Evans Wrote:

> around new config  
> [mailman.nginx.org archive](http://nginx.org/mailman/listinfo/nginx)  
> That’s my config. For one site, just remove that \_wordpress-cache.

I was using that setup to avoid some issues with using the same  
configuration for many sites. If you’re using one server config for a  
number of sites like this:

server\_name \_wordpress-cache [site1.com](http://site1.com) [site2.com](http://site2.com) [site3.com](http://site3.com) [site4.com](http://site4.com)  
[site5.com](http://site5.com);

Then the first server in the list gets used for certain things. It’s  
the HTTP\_SERVER variable used in some scripts. It’s the “server” that  
appears in logs. It’s the “server” that shows up in some email headers.  
So to avoid having [site1.com](http://site1.com) appear for [site2.com](http://site2.com) and [site3.com](http://site3.com) log  
entries and email headers, I used to put in a bogus server name to  
identify the config. Although that didn’t solve my problem with a  
certain php script that used HTTP\_SERVER instead of HTTP\_HOST.

I’m using another solution now to avoid the problem. I use a separate  
config file for each site and use an include file for the common  
config:

server {  
listen xx.xx.xx.xx.xx:80;  
server\_name [site1.com](http://site1.com);  
root /var/www/site1.com;  
access\_log /var/log/nginx/site1.com.access.log;  
include /etc/nginx/config/wordpress-cache;  
}

Then you put the entire config in your separate include file and only  
have one name listed for server\_name.

This is the config:  
[https://test.brianmercer.com/content/nginx-configuration-wordpress-wp-super-cache](https://test.brianmercer.com/content/nginx-configuration-wordpress-wp-super-cache)

I should reorganize those and put up a config for WP3 multisite and be  
clearer about how to reuse the config for multiple sites.

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

---

<div class="post-metadata">

**Author:** ![Ian\_MSEvans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/7bcc69/32.png) [@Ian\_MSEvans](https://www.ruby-forum.com/u/Ian_MSEvans)\
**Post date:** [December 1, 2010, 7:00pm UTC](https://www.ruby-forum.com/t/wordpress-cache-in-server-name/199899/4 "2010-12-01T19:00:08Z")

</div>

On Wed, December 1, 2010 7:49 am, brianmercer wrote:

> That’s my config. For one site, just remove that \_wordpress-cache.

Thanks for the config! I just have to get the SSL working for the  
/wp-admin and I think I’m off to the races. Guess I’ll have to read up  
on  
SNI seeing as the ssl’s sharing an IP.

---

<div class="post-metadata">

**Author:** ![Ian\_MSEvans](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/7bcc69/32.png) [@Ian\_MSEvans](https://www.ruby-forum.com/u/Ian_MSEvans)\
**Post date:** [December 1, 2010, 6:20pm UTC](https://www.ruby-forum.com/t/wordpress-cache-in-server-name/199899/5 "2010-12-01T18:20:33Z")

</div>

On 12/01/2010 04:12 AM, Ian M. Evans wrote:

> I saw this example for setting up nginx to run wordpress and wp-super cache

If you need a caching system for wordpress on Nginx you can try this

> **[NGINX Manager](https://wordpress.org/plugins/nginx-manager/)**
>
> Easily purge Nginx cache. Each time a post is modified clear the cached version of the page and of all the related page.

If you need more info/help just ask

Ciao

–  
Simone
