WC-Ajax在WordPress Multisite中效果不佳

时间:2018-10-14 19:35:05

标签: php wordpress woocommerce

我有一个使用Wordpress Multisite和Woocommerce的网站,但是Ajax请求似乎效果不佳。

例如:当付款并转到“结帐”页面时,部分总额未完成加载。如果检查网络请求,我们会看到查询“ / en /?wc-ajax = update_order_review”返回错误代码200,但答案是html站点的所在地。但是在同一安装中的另一个站点中,json返回了相同的请求。

Here we can see how the load hangs

您可以在以下链接中看到此行为:

两个站点都具有相同的已安装插件,相同的主题以及几乎相同的内容和配置。唯一真正改变的是每个站点所使用的语言(一个用西班牙语,另一个用英语)。

系统状态英文版

### WordPress Environment ###

Home URL: http://beta.canopyriver.com/en
Site URL: http://beta.canopyriver.com/en
WC Version: 3.4.6
Log Directory Writable: ✔
WP Version: 4.9.8
WP Multisite: ✔
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: en_US
External object cache: –

### Server Environment ###

Server Info: nginx/1.4.6
PHP Version: 5.5.9-1ubuntu4.26 - ❌ WooCommerce will run under this version of PHP
however
it has reached end of life. We recommend using PHP version 7.2 or above for greater performance and security. How to update your PHP version

PHP Post Max Size: 10 MB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 
SUHOSIN Installed: –
MySQL Version: ❌ 5.5.61-0ubuntu0.14.04.1 - We recommend a minimum MySQL version of 5.6. See: WordPress requirements
Max Upload Size: 1 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

### Database ###

WC Database Version: 3.4.6
WC Database Prefix: cn_2_
MaxMind GeoIP Database: ✔
Total Database Size: 16.63MB
Database Data Size: 11.94MB
Database Index Size: 4.69MB
cn_2_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB
cn_2_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB
cn_2_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB
cn_2_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB
cn_2_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB
cn_2_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB
cn_2_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB
cn_2_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB
cn_2_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB
cn_2_woocommerce_log: Data: 0.02MB + Index: 0.02MB
cn_2_cf7_vdata: Data: 0.02MB + Index: 0.00MB
cn_2_cf7_vdata_entry: Data: 0.02MB + Index: 0.00MB
cn_2_commentmeta: Data: 0.02MB + Index: 0.03MB
cn_2_comments: Data: 0.02MB + Index: 0.09MB
cn_2_links: Data: 0.02MB + Index: 0.02MB
cn_2_options: Data: 1.20MB + Index: 0.05MB
cn_2_postmeta: Data: 2.52MB + Index: 1.89MB
cn_2_posts: Data: 1.41MB + Index: 0.14MB
cn_2_termmeta: Data: 0.02MB + Index: 0.03MB
cn_2_terms: Data: 0.02MB + Index: 0.03MB
cn_2_term_relationships: Data: 0.02MB + Index: 0.02MB
cn_2_term_taxonomy: Data: 0.02MB + Index: 0.03MB
cn_2_wc_download_log: Data: 0.02MB + Index: 0.03MB
cn_2_wc_webhooks: Data: 0.02MB + Index: 0.02MB
cn_2_wdi_feeds: Data: 0.02MB + Index: 0.02MB
cn_2_wdi_themes: Data: 0.02MB + Index: 0.02MB
cn_blogs: Data: 0.02MB + Index: 0.03MB
cn_blog_versions: Data: 0.02MB + Index: 0.02MB
cn_bwg_album: Data: 0.02MB + Index: 0.00MB
cn_bwg_album_gallery: Data: 0.02MB + Index: 0.00MB
cn_bwg_gallery: Data: 0.02MB + Index: 0.00MB
cn_bwg_image: Data: 0.02MB + Index: 0.00MB
cn_bwg_image_comment: Data: 0.02MB + Index: 0.00MB
cn_bwg_image_rate: Data: 0.02MB + Index: 0.00MB
cn_bwg_image_tag: Data: 0.02MB + Index: 0.00MB
cn_bwg_shortcode: Data: 0.02MB + Index: 0.00MB
cn_bwg_theme: Data: 0.08MB + Index: 0.00MB
cn_cf7_vdata: Data: 0.02MB + Index: 0.00MB
cn_cf7_vdata_entry: Data: 0.02MB + Index: 0.00MB
cn_commentmeta: Data: 0.02MB + Index: 0.03MB
cn_comments: Data: 0.02MB + Index: 0.09MB
cn_links: Data: 0.02MB + Index: 0.02MB
cn_options: Data: 2.25MB + Index: 0.05MB
cn_postmeta: Data: 1.52MB + Index: 0.70MB
cn_posts: Data: 1.52MB + Index: 0.20MB
cn_registration_log: Data: 0.02MB + Index: 0.02MB
cn_signups: Data: 0.02MB + Index: 0.06MB
cn_site: Data: 0.02MB + Index: 0.02MB
cn_sitemeta: Data: 0.03MB + Index: 0.03MB
cn_termmeta: Data: 0.02MB + Index: 0.03MB
cn_terms: Data: 0.02MB + Index: 0.03MB
cn_term_relationships: Data: 0.02MB + Index: 0.02MB
cn_term_taxonomy: Data: 0.02MB + Index: 0.03MB
cn_usermeta: Data: 0.05MB + Index: 0.03MB
cn_users: Data: 0.02MB + Index: 0.05MB
cn_wc_download_log: Data: 0.02MB + Index: 0.03MB
cn_wc_webhooks: Data: 0.02MB + Index: 0.02MB
cn_wdi_feeds: Data: 0.02MB + Index: 0.02MB
cn_wdi_themes: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB
cn_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB
cn_woocommerce_log: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB
cn_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB
cn_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB
cn_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB
cn_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB
cn_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB
cn_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB

### Post Type Counts ###

acf-field: 70
acf-field-group: 6
attachment: 355
custom_css: 2
customize_changeset: 5
mc4wp-form: 1
nav_menu_item: 34
page: 17
post: 3
product: 13
product_variation: 54
revision: 55
robo_gallery_table: 15
shop_coupon: 1
shop_order: 6
transtops: 4
wdi_instagram: 1
wpcf7_contact_form: 2

### Security ###

Secure connection (HTTPS): ❌
                    Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
Hide errors from visitors: ✔

### Active Plugins (26) ###

Advanced Custom Fields: Image Select: by Dinesh Kesarwani – 1.0.1
Advanced CF7 DB: by Vsourz Digital – 1.4.4
Advanced Custom Fields: Font Awesome: by mattkeys – 2.1.2
Advanced Custom Fields PRO: by Elliot Condon – 5.7.0
Akismet Anti-Spam: by Automattic – 4.0.8
Canopy Blocks: by Jesús Magallón – 1.1.0
Contact Form 7 Syntax Highlighting: by Joris van Montfort – 0.2.3
Contact Form 7: by Takayuki Miyoshi – 5.0.4
Gutenberg: by Gutenberg Team – 3.9.0
MailChimp for WordPress: by ibericode – 4.2.5
Max Mega Menu: by megamenu.com – 2.5.2
Robo Gallery: by RoboSoft – 2.8.10
Robo Gallery Key: by RoboSoft – 1.5
SMTP Mailer: by naa986 – 1.0.5
Instagram Feed by 10Web: by 10Web – 1.3.7
WooCommerce Gutenberg Products Block: by Automattic – 1.1.2
WooCommerce Permalink Manager: by premmerce – 2.1.2
WooCommerce PayPal Checkout Gateway: by WooCommerce – 1.6.4
WooCommerce: by Automattic – 3.4.6
WordPress Importer: by wordpressdotorg – 0.6.4
WooCommerce Canopy Booking: by Jesús Magallón – 1.9.0 – Not tested with the active version of WooCommerce
WooCommerce: by Automattic – 3.4.6
WooCommerce Gutenberg Products Block: by Automattic – 1.1.2
WooCommerce PayPal Checkout Gateway: by WooCommerce – 1.6.4
WooCommerce Permalink Manager: by premmerce – 2.1.2
Nginx Helper: by rtCamp – 1.9.12

### Settings ###

API Enabled: –
Force SSL: –
Currency: USD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: booking (booking)
canopytour (canopytour)
external (external)
grouped (grouped)
phive_booking (phive_booking)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)


### WC Pages ###

Shop base: #955 - /activities/
Cart: #8 - /cart/
Checkout: #9 - /checkout/
My account: #10 - /my-account/
Terms and conditions: ❌ Page not set

### Theme ###

Name: theme
Version: 1.0.0
Author URL: http://yosoydev.net
Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
WooCommerce Support: ✔

### Templates ###

Overrides: theme/woocommerce/archive-product.php
theme/woocommerce/cart/mini-cart.php
theme/woocommerce/checkout/form-checkout.php
theme/woocommerce/content-product.php
theme/woocommerce/emails/admin-new-order.php
theme/woocommerce/emails/email-addresses.php
theme/woocommerce/emails/email-order-details.php
theme/woocommerce/emails/email-order-items.php
theme/woocommerce/emails/email-styles.php
theme/woocommerce/global/quantity-input.php
theme/woocommerce/loop/price.php
theme/woocommerce/order/order-details-customer.php
theme/woocommerce/order/order-details-item.php
theme/woocommerce/order/order-details.php
theme/woocommerce/single-product/tabs/tabs.php
theme/woocommerce/single-product-reviews.php

系统状态西班牙语版本

### WordPress Environment ###

Home URL: http://beta.canopyriver.com
Site URL: http://beta.canopyriver.com
WC Version: 3.4.6
Log Directory Writable: ✔
WP Version: 4.9.8
WP Multisite: ✔
WP Memory Limit: 256 MB
WP Debug Mode: –
WP Cron: ✔
Language: es_MX
External object cache: –

### Server Environment ###

Server Info: nginx/1.4.6
PHP Version: 5.5.9-1ubuntu4.26 - ❌ WooCommerce trabajará bajo esta versión de PHP
sin embargo
ha llegado a su final. Recomendamos utilizar la versión 7.2 de PHP o superior para un mejor rendimiento y seguridad. Cómo actualizar tu versión de PHP

PHP Post Max Size: 10 MB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 
SUHOSIN Installed: –
MySQL Version: ❌ 5.5.61-0ubuntu0.14.04.1 - Recomendamos que la mínima versión de PHP sea 5.6. Ver: Requerimientos de WordPress
Max Upload Size: 1 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

### Database ###

WC Database Version: 3.4.6
WC Database Prefix: cn_
MaxMind GeoIP Database: ✔
Tamaño Total de la Base de Datos: 16.63MB
Tamaño de la Base de Datos: 11.94MB
Tamaño del índice de la Base de Datos: 4.69MB
cn_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB
cn_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB
cn_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB
cn_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB
cn_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB
cn_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB
cn_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB
cn_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB
cn_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB
cn_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB
cn_woocommerce_log: Data: 0.02MB + Index: 0.02MB
cn_2_cf7_vdata: Data: 0.02MB + Index: 0.00MB
cn_2_cf7_vdata_entry: Data: 0.02MB + Index: 0.00MB
cn_2_commentmeta: Data: 0.02MB + Index: 0.03MB
cn_2_comments: Data: 0.02MB + Index: 0.09MB
cn_2_links: Data: 0.02MB + Index: 0.02MB
cn_2_options: Data: 1.20MB + Index: 0.05MB
cn_2_postmeta: Data: 2.52MB + Index: 1.89MB
cn_2_posts: Data: 1.41MB + Index: 0.14MB
cn_2_termmeta: Data: 0.02MB + Index: 0.03MB
cn_2_terms: Data: 0.02MB + Index: 0.03MB
cn_2_term_relationships: Data: 0.02MB + Index: 0.02MB
cn_2_term_taxonomy: Data: 0.02MB + Index: 0.03MB
cn_2_wc_download_log: Data: 0.02MB + Index: 0.03MB
cn_2_wc_webhooks: Data: 0.02MB + Index: 0.02MB
cn_2_wdi_feeds: Data: 0.02MB + Index: 0.02MB
cn_2_wdi_themes: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB
cn_2_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB
cn_2_woocommerce_log: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB
cn_2_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB
cn_2_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB
cn_2_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB
cn_2_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB
cn_2_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB
cn_2_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB
cn_2_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB
cn_blogs: Data: 0.02MB + Index: 0.03MB
cn_blog_versions: Data: 0.02MB + Index: 0.02MB
cn_bwg_album: Data: 0.02MB + Index: 0.00MB
cn_bwg_album_gallery: Data: 0.02MB + Index: 0.00MB
cn_bwg_gallery: Data: 0.02MB + Index: 0.00MB
cn_bwg_image: Data: 0.02MB + Index: 0.00MB
cn_bwg_image_comment: Data: 0.02MB + Index: 0.00MB
cn_bwg_image_rate: Data: 0.02MB + Index: 0.00MB
cn_bwg_image_tag: Data: 0.02MB + Index: 0.00MB
cn_bwg_shortcode: Data: 0.02MB + Index: 0.00MB
cn_bwg_theme: Data: 0.08MB + Index: 0.00MB
cn_cf7_vdata: Data: 0.02MB + Index: 0.00MB
cn_cf7_vdata_entry: Data: 0.02MB + Index: 0.00MB
cn_commentmeta: Data: 0.02MB + Index: 0.03MB
cn_comments: Data: 0.02MB + Index: 0.09MB
cn_links: Data: 0.02MB + Index: 0.02MB
cn_options: Data: 2.25MB + Index: 0.05MB
cn_postmeta: Data: 1.52MB + Index: 0.70MB
cn_posts: Data: 1.52MB + Index: 0.20MB
cn_registration_log: Data: 0.02MB + Index: 0.02MB
cn_signups: Data: 0.02MB + Index: 0.06MB
cn_site: Data: 0.02MB + Index: 0.02MB
cn_sitemeta: Data: 0.03MB + Index: 0.03MB
cn_termmeta: Data: 0.02MB + Index: 0.03MB
cn_terms: Data: 0.02MB + Index: 0.03MB
cn_term_relationships: Data: 0.02MB + Index: 0.02MB
cn_term_taxonomy: Data: 0.02MB + Index: 0.03MB
cn_usermeta: Data: 0.05MB + Index: 0.03MB
cn_users: Data: 0.02MB + Index: 0.05MB
cn_wc_download_log: Data: 0.02MB + Index: 0.03MB
cn_wc_webhooks: Data: 0.02MB + Index: 0.02MB
cn_wdi_feeds: Data: 0.02MB + Index: 0.02MB
cn_wdi_themes: Data: 0.02MB + Index: 0.02MB

### Post Type Counts ###

acf-field: 81
acf-field-group: 8
attachment: 352
bookable_person: 2
bookable_resource: 4
customize_changeset: 20
custom_css: 1
mc4wp-form: 1
nav_menu_item: 32
oembed_cache: 1
page: 30
post: 3
product: 14
product_variation: 64
revision: 219
robo_gallery_table: 13
shop_coupon: 2
shop_order: 9
transtops: 4
wdi_instagram: 1
wpcf7_contact_form: 2

### Security ###

Secure connection (HTTPS): ❌
                    Tu tienda no está usando HTTPS. Aprende más sobre HTTPS y los Certificados SSL.
Hide errors from visitors: ✔

### Active Plugins (26) ###

Advanced Custom Fields: Image Select: por Dinesh Kesarwani – 1.0.1
Advanced CF7 DB: por Vsourz Digital – 1.4.4
Advanced Custom Fields: Font Awesome: por mattkeys – 2.1.2
Advanced Custom Fields PRO: por Elliot Condon – 5.7.0
Akismet Anti-Spam: por Automattic – 4.0.8
Canopy Blocks: por Jesús Magallón – 1.1.0
Contact Form 7 Syntax Highlighting: por Joris van Montfort – 0.2.3
Contact Form 7: por Takayuki Miyoshi – 5.0.4
Display text domains: por Pavel Riha – 1.1.1
Gutenberg: por Gutenberg Team – 3.9.0
MailChimp for WordPress: por ibericode – 4.2.5
Max Mega Menu: por megamenu.com – 2.5.2
Robo Gallery: por RoboSoft – 2.8.10
Robo Gallery Key: por RoboSoft – 1.5
SMTP Mailer: por naa986 – 1.0.5
Instagram Feed by 10Web: por 10Web – 1.3.7
WooCommerce Gutenberg Products Block: por Automattic – 1.1.2
WooCommerce Permalink Manager: por premmerce – 2.1.2
WooCommerce PayPal Checkout Gateway: por WooCommerce – 1.6.4
WooCommerce: por Automattic – 3.4.6
WooCommerce Canopy Booking: por Jesús Magallón – 1.9.0 – No ha sido probado con la versión actual de WooCommerce
WooCommerce: por Automattic – 3.4.6
WooCommerce Gutenberg Products Block: por Automattic – 1.1.2
WooCommerce PayPal Checkout Gateway: por WooCommerce – 1.6.4
WooCommerce Permalink Manager: por premmerce – 2.1.2
Nginx Helper: por rtCamp – 1.9.12

### Settings ###

API Enabled: –
Force SSL: –
Currency: USD ($)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: booking (booking)
canopytour (canopytour)
external (external)
grouped (grouped)
phive_booking (phive_booking)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)


### WC Pages ###

Tienda Base: #7 - /actividades/
Carrito: #8 - /cart/
Pago: #9 - /checkout/
Mi cuenta: #10 - /my-account/
Términos y condiciones: ❌ Página no establecida

### Theme ###

Name: theme
Version: 1.0.0
Author URL: http://yosoydev.net
Child Theme: ❌ – Si estás modificando WooCommerce o un tema que no hiciste tu
recomendamos usar un tema hijo (child theme). Ver Cómo crear un tema hijo (child theme)

WooCommerce Support: ✔

### Templates ###

Overrides: theme/woocommerce/archive-product.php
theme/woocommerce/cart/mini-cart.php
theme/woocommerce/checkout/form-checkout.php
theme/woocommerce/content-product.php
theme/woocommerce/emails/admin-new-order.php
theme/woocommerce/emails/email-addresses.php
theme/woocommerce/emails/email-order-details.php
theme/woocommerce/emails/email-order-items.php
theme/woocommerce/emails/email-styles.php
theme/woocommerce/global/quantity-input.php
theme/woocommerce/loop/price.php
theme/woocommerce/order/order-details-customer.php
theme/woocommerce/order/order-details-item.php
theme/woocommerce/order/order-details.php
theme/woocommerce/single-product/tabs/tabs.php
theme/woocommerce/single-product-reviews.php

Nginx Wordpress多站点配置

map $http_host $blog_id {
        default 0;
        include /path/to/my/theme/wp-content/uploads/nginx-helper/map.conf;}

server {
        listen 80;

        root /path/to/my/theme;
        index index.php index.html index.htm;

        server_name beta.canopyriver.com;

        location / {
                try_files $uri $uri/ /index.php?$is_args$args;
        }

        location ~ ^/files/(.*)$ {
                try_files /wp-content/blogs.dir/$blog_id/$uri /wp-includes/ms-files.php?file=$1;
                access_log off; log_not_found off; expires max;        }

        error_page 404 /404.html;

        location = /50x.html {
                root /path/to/my/theme;
        }

        location ~ \.php$ {
                try_files $uri =404;
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_read_timeout 300;
                fastcgi_index index.php;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include fastcgi_params;
        }

        location = /favicon.ico {
                log_not_found off;
                access_log off;
        }

        location = /robots.txt {
                allow all;
                log_not_found off;
                access_log off;
        }
        location ~* \.(jpg|jpeg|png|gif|ico|svg|css|js|otf|woff)$ { expires 15d; }

        location ^~ /blogs.dir {
                internal;
                alias /path/to/my/theme/wp-content/blogs.dir;
                access_log off; log_not_found off; expires max;
        }

        if (!-e $request_filename) {
                rewrite /wp-admin$ $scheme://$host$uri/ permanent;
                rewrite ^/[_0-9a-zA-Z-]+(/wp-.*) $1 last;
                rewrite ^/[_0-9a-zA-Z-]+(/.*\.php)$ $1 last;
        }

        access_log   off;
        error_log    /path/to/nginx/error.log;
}

server {
        listen 80;
        server_name www.beta.canopyriver.com;
        rewrite ^(.*) http://beta.canopyriver.com$1 permanent;
}

有人知道为什么一个版本有效而​​另一个版本无效吗?

0 个答案:

没有答案