[wp-trac] [WordPress Trac] #35561: function wp_admin_canonical_url() not using configured site url when constructing canonical url link tag
WordPress Trac
noreply at wordpress.org
Fri Nov 13 02:44:37 UTC 2020
#35561: function wp_admin_canonical_url() not using configured site url when
constructing canonical url link tag
--------------------------------------------+------------------------------
Reporter: ilude | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Administration | Version: 4.4.1
Severity: normal | Resolution:
Keywords: reporter-feedback dev-feedback | Focuses: administration
--------------------------------------------+------------------------------
Changes (by danychen):
* keywords: reporter-feedback => reporter-feedback dev-feedback
Comment:
I have this problem too, the thing is that if you use reverse proxy, you
got let the REQUEST_URI contain the **prefix** for admin to work. which
makes deploy a bit inconvenient, mostly you cloud add an addition dir for
the path to be correct.
In nginx you can do:
{{{
location /blog {
alias /Users/dany/Projects/blog;
try_files $uri $uri/ /index.php$is_args$args;
location ~* "\.php$" {
fastcgi_pass unix:/Users/dany/.phpbrew/php/php-7.0.33/var/run/php-
fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}
}
}}}
which makes you REQUEST_URI to be the full url, but the actual script is
not in blog dir.
In docker it's a bit easier to just include additional path for the
prefix, such as -v ./src:/var/www/html/blog
you can control it to work, but if you don't have control over the blog,
then reverse proxy just don't work on admin unless use some sort of way
the manipulate the REQUEST_URI.
== Conclusion:
**I think the Point is that why admin and front end have different
behavior for how url is constructed**, we can make configs that make it to
work provided that we have control over the wordpress deployment.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35561#comment:9>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list