Solutions
Pricing
Resources
What's new
Languages
English
French
Chinese
Spanish
Start free trial
Ecommerce Shopify WordPress Discussion
Home
/
ask me anything
/
/
What is the Nginx Conf for WordPress Multisites if this multisites `location` is in another `location`?
What is the Nginx Conf for WordPress Multisites if this multisites `location` is in another `location`?
Let assume that I have the following directory structure: /var/www/html `- site_a `- site_b `- site_c `- multisites I want to install and enable wordpress multisites under multisites directory. But I cannot access to this directory, even after studying this Nginx official settings Here is my nginx.conf: map $uri $blogname{ ~^(?P<blogpath>/[^/]+/)files/(.*) $blogpath ; } map $blogname $blogid{ default -999; #Ref: http://wordpress.org/extend/plugins/nginx-helper/ #include /var/www/wordpress/wp-content/plugins/nginx-helper/map.conf ; } server { listen 80; listen [::]:80; server_name localhost.local; http2 on; index index.php index.html index.htm; proxy_buffer_size 256k; proxy_buffers 4 512k; proxy_busy_buffers_size 512k; proxy_max_temp_file_size 0; root /var/www/html; location ~* xmlrpc.php { deny all; return 404; } # https://www.nginx.com/resources/wiki/start/topics/recipes/wordpress/#rewrite-rules-for-multisite location ~* /multisites { index index.php; location ~ ^(/[^/]+)?/files/(.+) { try_files /wp-content/blogs.dir/$blogid/files/$2 /wp-includes/ms-files.php?file=$2 ; access_log off; log_not_found off; expires max; } #avoid php readfile() location ^~ /multisites/blogs.dir { internal; alias /var/www/html/multisites/wp-content/blogs.dir ; access_log off; log_not_found off; expires max; } if (!-e $request_filename) { rewrite_log on; rewrite /wp-admin$ $scheme://$host$uri/ permanent; rewrite ^(/[^/]+)?(/wp-.*) $2 last; rewrite ^(/[^/]+)?(/.*\.php) $2 last; } location / { try_files $uri $uri/ /index.php?$args ; } location ~ \.php$ { try_files $uri =404; include fastcgi_params; fastcgi_pass php:9000; } } location ~ ^/(site_a|site_b)/wp-json/ { # if permalinks not enabled rewrite ^/cms/wp-json/(.*?)$ /cms/?rest_route=/$1 last; } location ~ ^/(site_a|site_b)/ { root /var/www/html; try_files $uri $uri/ /$1/index.php$is_args$args; location ~* \.(?:ico|css|js|gif|jpe?g|png|svg)$ { expires 365d; add_header Pragma public; add_header Cache-Control "public"; } location ~ \.php$ { include fastcgi_params; fastcgi_pass php:9000; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_hide_header X-Powered-By; fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } } location ~ / { root /var/www/html; try_files $uri $uri/ index.php?$query_string; location ~* \.(?:ico|css|js|gif|jpe?g|png|svg)$ { expires 365d; add_header Pragma public; add_header Cache-Control "public"; } location ~ \.php$ { include fastcgi_params; fastcgi_pass php:9000; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_hide_header X-Powered-By; fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } } location ~ \.php$ { include fastcgi_params; fastcgi_pass php:9000; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_index index.php; fastcgi_hide_header X-Powered-By; fastcgi_param SCRIPT_FILENAME /var/www/html/$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } } Can anyone please help me on this? Thank you for your help.
Turbo Multi-language Translator
Make the better internet purchasing globaly
Turbosify SEO Speed Booster
5.0 (7)
•
Free plan available
Get better conversions by improving store loading speed
Installed
Turbo Multi-language Chat - AI Customer service in one hand
Shopify: Automatic Discount Detail On Product Detail Page
Megamenu implementation on Shopify Store. CSS gets messed up
how to update total on click plus and minus button shopify cart page
Many issues trying to register webhooks for customs shopify app. Was working till it wasnt
How to get content of the home page in Shopify Storefront API?
Our products
The help you need, when you need it
App by Turbo Engine
3 apps • 5.0 average rating
Turbosify Speed Booster
5.0 (7)
Get better conversions by optimizing shopify store Google page speed
Installed
Turbosify Translator for Wordpress Woocommerce
5.0 (74)
•
Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no
No technical required
Grow your business here
Whether you want to sell products down the street or around the world, we have all the tools you need.
Start free trial