Me too, I’ve been using Hestia for over 2 years and haven’t had those issues either.
probably is there an issue / bug on default wordpress template on hestia?
Remove this directive.
Done, restarted nginx, same problem
Then the problem is WordPress, it’s the one doing the redirection and not getting the host. I’m using this template on my test WordPress site, and I can’t reproduce the issue. Everything works as expected on all pages, even when using HTTP/3.
/usr/local/hestia/data/templates/web/nginx/php-fpm/wordpress-http3.tpl
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
server {
listen %ip%:%web_port%;
server_name %domain_idn% %alias_idn%;
root %docroot%;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
include %home%/%user%/conf/web/%domain%/nginx.forcessl.conf*;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
try_files $uri $uri/ /index.php?$args;
log_not_found off;
access_log off;
}
location ~ /\.(?!well-known\/) {
deny all;
return 404;
}
location = /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
return 403;
}
location / {
try_files $uri $uri/ /index.php?$args;
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
expires 30d;
fastcgi_hide_header "Set-Cookie";
}
location ~* /(?:uploads|files)/.*.php$ {
deny all;
return 404;
}
location ~ [^/]\.php(/|$) {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
if ($request_uri ~* "/wp-admin/|/wp-json/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
set $no_cache 1;
}
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {
set $no_cache 1;
}
}
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location /vstats/ {
alias %home%/%user%/web/%domain%/stats/;
include %home%/%user%/web/%domain%/stats/auth.conf*;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include %home%/%user%/conf/web/%domain%/nginx.conf_*;
}
/usr/local/hestia/data/templates/web/nginx/php-fpm/wordpress-http3.stpl
#=========================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
# https://hestiacp.com/docs/server-administration/web-templates.html #
#=========================================================================#
server {
listen %ip%:%web_ssl_port% quic;
listen %ip%:%web_ssl_port% ssl;
server_name %domain_idn% %alias_idn%;
root %sdocroot%;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
access_log /var/log/nginx/domains/%domain%.bytes bytes;
error_log /var/log/nginx/domains/%domain%.error.log error;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
# ssl_stapling on;
# ssl_stapling_verify on;
# TLS 1.3 0-RTT anti-replay
if ($anti_replay = 307) { return 307 https://$host$request_uri; }
if ($anti_replay = 425) { return 425; }
add_header Alt-Svc 'h3=":$server_port"; ma=86400';
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
try_files $uri $uri/ /index.php?$args;
log_not_found off;
access_log off;
}
location ~ /\.(?!well-known\/) {
deny all;
return 404;
}
location = /xmlrpc.php {
deny all;
access_log off;
log_not_found off;
return 403;
}
location / {
try_files $uri $uri/ /index.php?$args;
location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|webp|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
expires 30d;
fastcgi_hide_header "Set-Cookie";
}
location ~* /(?:uploads|files)/.*.php$ {
deny all;
return 404;
}
location ~ [^/]\.php(/|$) {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_param HTTP_EARLY_DATA $rfc_early_data if_not_empty;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
if ($request_uri ~* "/wp-admin/|/wp-json/|wp-.*.php|xmlrpc.php|index.php|/store.*|/cart.*|/my-account.*|/checkout.*") {
set $no_cache 1;
}
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in|woocommerce_items_in_cart|woocommerce_cart_hash|PHPSESSID") {
set $no_cache 1;
}
}
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location /vstats/ {
alias %home%/%user%/web/%domain%/stats/;
include %home%/%user%/web/%domain%/stats/auth.conf*;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
}
tried your template. same problem. I don’t understand! it’s weird…
take a look here, you’re more experienced than me:
Risolto - Nginx HTTP3 causa reindirizzamento invalido su WordPress | Plesk Forum
I can’t find /etc/nginx/fastcgi.conf
@sahsanu it works fine. I found the solution.
Adding fastcgi_param HTTP_HOST $host; into /etc/nginx/fastcgi__params
Thanks for sharing. I can’t reproduce it on my site because WordPress doesn’t do any redirection.
Could you please open an issue so I can create a PR to add it to next release?
Absolutely!
Created at [Bug] Redirect error on WordPress enabling NGINX HTTP3 · Issue #5184 · hestiacp/hestiacp
Tell me if I have to edit something, I never did it.
Thanks
No, that’s enough, thanks.
Hestia doesn’t modify /etc/nginx/fastcgi_params, it’s the conf included by default in Nginx so I think it would be better to modify the WordPress templates.
Can I add fastcgi_param HTTP_HOST $host;directly into WordPress template?
Yes, you can.
I’ve created this PR:
If you want to test it, you can download the wordpress-http3 template. I’ve also added a script to automatically add reuseport if none of the sites are using it. If some site is already using it, the next domains will use only quic.
cd /usr/local/hestia/data/templates/web/nginx/php-fpm
curl -fsSLm10 https://raw.githubusercontent.com/sahsanu/hestiacp/bfceecb57bf9c6a9926e82631112662619f3e2ad/install/deb/templates/web/nginx/php-fpm/wordpress-http3.sh -O
chmod +x wordpress-http3.sh
curl -fsSLm10 https://raw.githubusercontent.com/sahsanu/hestiacp/bfceecb57bf9c6a9926e82631112662619f3e2ad/install/deb/templates/web/nginx/php-fpm/wordpress-http3.stpl -O
curl -fsSLm10 https://raw.githubusercontent.com/sahsanu/hestiacp/bfceecb57bf9c6a9926e82631112662619f3e2ad/install/deb/templates/web/nginx/php-fpm/wordpress-http3.tpl -O
Once all the files are downloaded, you can assign the wordpress-http3 template to your domains to test it.
I would appreciate it if you could test it.
I deleted the change made it into /etc/nginx/fastcgi_params, I reproduced the issue again, I deleted all templates http3 created by myself and add your change.
It works perfectly!
Thanks
Hi everyone, as I remember we already did this, since then the directive lives in my template)
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.