Welcome! Log In Create A New Profile

Advanced

Re: Wordpress Multi-Site Converting Apache to Nginx

Francis Daly
April 29, 2014 06:42PM
On Tue, Apr 29, 2014 at 04:27:36PM -0400, nrahl wrote:

Hi there,

> Some of the links want to go to a URL like /wp-admin/network/ and it should
> silently redirect to /wordpress/wp-admin/network/. That's what the first
> apache rule does. I've tried to create an Nginx rule:
>
> location ^~ ^/(wp-(content|admin|includes).*) {
> try_files /wordpress/$1 =404;
> }
>
> But I get a 404. So its matching the pattern but not loading the redirected
> content.

That's not what is happening. "location ^~" is a prefix match, not a
regex match, so this location is probably not being used by anything.

> I also have some pattern matching functions that insist on matching URLs
> they aren't supposed to. The ^~ is supposed to make the rule a higher
> priority, but it does not work.

That's not what ^~ means.

> These are all the location blocks I have on the server:
>
> index Director.php index.php;
>
> location ^~ ^/(wp-(content|admin|includes).*) {

That probably won't match any request.

> location ^~ ^/blog/([a-zA-Z0-9\-\_]+)/ {

That probably won't match any request.

> # Attempt to match Slugs for Director
> location ~ ^/([a-zA-Z0-9\-\_]+)/$ {

That should match requests of the form /XXX/.

> location ~ ^/([a-zA-Z0-9\-\_]+)/([a-zA-Z0-9\-\_]+)/$ {

That should match requests of the form /XXX/YYY/.

> location / {

That should match any request that does not otherwise match a location.

> # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
> location ~ \.php$ {

That should match a request of the form /XXX.php.

> What am I doing wrong?

Misunderstanding what "location" does?

http://nginx.org/r/location

What request do you make?

Which one of the above locations does the request match?

What output do you expect?

What output do you get?

(And what do the logs say?)

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Wordpress Multi-Site Converting Apache to Nginx

nrahl April 29, 2014 04:27PM

Re: Wordpress Multi-Site Converting Apache to Nginx

Francis Daly April 29, 2014 06:42PM

Re: Wordpress Multi-Site Converting Apache to Nginx

nrahl April 30, 2014 02:46AM

Re: Wordpress Multi-Site Converting Apache to Nginx

Francis Daly April 30, 2014 03:16AM

Re: Wordpress Multi-Site Converting Apache to Nginx

nrahl May 01, 2014 02:07AM

Re: Wordpress Multi-Site Converting Apache to Nginx

GreenGecko May 01, 2014 02:28AM

Re: Wordpress Multi-Site Converting Apache to Nginx

nrahl May 01, 2014 03:02AM

Re: Wordpress Multi-Site Converting Apache to Nginx

Alan Chandler May 08, 2014 03:32PM

Re: Wordpress Multi-Site Converting Apache to Nginx

Francis Daly May 01, 2014 02:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 295
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready