I saw this example for setting up nginx to run wordpress and wp-super
cache
server_name _wordpress-cache 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!
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
Ian M. Evans Wrote:
around new config
nginx Info Page
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 site2.com site3.com site4.com
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 appear for site2.com and 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;
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
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:
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.
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
If you need more info/help just ask
Ciao
–
Simone