Welcome! Log In Create A New Profile

Advanced

Почему http3 удаляет домен из всех ссылок?

January 31, 2023 02:07PM
Итак, пару дней назад я установил NGINX 1.23.2 QUIC с Brotli, TLS 1.3, OpenSSL 1.1.1q с HTTP/2 и HTTP/3... сервер с fastcgi и php-fpm... когда я загружаю сайт в первый раз он работает с http2 и все в порядке. После перезагрузки страницы, или я посещаю на сайте какую-то статью или категорию, в ссылках больше нет example.com... например https://example.com/somecat/subcat... с http3 это https://somecat/subcat... много часов пытался найти проблему но ничего не получается, даже не представляю где искать.

Единственное, если я ставлю proxy_pass example.com; после location / { это устраняет проблему только для главной страницы, но не для всего сайта (категории... и т. д.). Может быть, у кого-то была такая проблема...

nginx -V

nginx version: nginx/1.23.2
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.1.1q+quic 5 Jul 2022
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --add-module=/home/builder/rpmbuild/BUILD/nginx-1.23.3/ngx_brotli --add-module=/home/builder/rpmbuild/BUILD/nginx-1.23.3/ngx_cache_purge-2.3 --add-module=/home/builder/rpmbuild/BUILD/nginx-1.23.3/ngx_http_geoip2_module-3.4 --with-http_v3_module --with-stream_quic_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'

Конфиг хоста

server {
listen IP:443 http3;
listen IP:443 ssl http2;
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
ssl_certificate /home/admin/conf/web/ssl.example.com.pem;
ssl_certificate_key /home/admin/conf/web/ssl.example.com.key;
}

server {
listen IP:443 http3 reuseport;
listen IP:443 ssl http2;
server_name example.com;
root /home/admin/web/example.com/public_html;
index index.php index.html index.htm;
#access_log /var/log/nginx/domains/example.com.log combined;
#access_log /var/log/nginx/domains/example.com.bytes bytes;
access_log off;
error_log /var/log/nginx/domains/example.com.error.log error;


ssl_protocols TLSv1.2 TLSv1.3;
quic_retry on;
ssl_early_data on;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_ciphers TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:ECDHE:!COMPLEMENTOFDEFAULT;
#ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES256-GCM-SHA384:AES128-GCM-SHA256:AES256-SHA256:AES128-SHA256:AES256-SHA:AES128-SHA:DES-CBC3-SHA:HIGH:!aNULL:!eNULL:!EXPORT:!DES:!MD5:!PSK:!RC4;
ssl_ecdh_curve X25519:prime256v1:secp384r1;
ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
ssl_prefer_server_ciphers off;
ssl_session_tickets off;
ssl_buffer_size 8k;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 valid=300s;
resolver_timeout 5s;
ssl_trusted_certificate /etc/pki/tls/certs/ca-bundle.crt;


ssl_certificate /home/admin/conf/web/ssl.example.com.pem;
ssl_certificate_key /home/admin/conf/web/ssl.example.com.key;
add_header Strict-Transport-Security "max-age=31536000; includeSubdomains; preload";
http2_push_preload on;

add_header Alt-Svc 'h3=":443"; ma=86400, h3-29=":443"; ma=86400';
add_header QUIC-Status $http3;

include /etc/nginx/badbots.conf;

location / {


rewrite "^/pm(/(.*))?/?$" /index.php?do=pm last;
rewrite "^/friends/([^/]*)(/?)+$" /index.php?do=friends&user=$1 last;
rewrite "^/friends/([^/]*)/page/([0-9]+)(/?)+$" /index.php?do=friends&user=$1&cstart=$2 last;
rewrite "^/friends/([^/]*)/common(/?)+$" /index.php?do=friends&subaction=common&user=$1 last;
rewrite "^/friends/([^/]*)/common/page/([0-9]+)(/?)+$" /index.php?do=friends&subaction=common&user=$1&cstart=$2 last;
rewrite "^/friends/([^/]*)/requests(/?)+$" /index.php?do=friends&subaction=requests&user=$1 last;
rewrite "^/friends/([^/]*)/requests/page/([0-9]+)(/?)+$" /index.php?do=friends&subaction=requests&user=$1&cstart=$2 last;

location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js|woff|woff2|webp)$ {
expires max;
}

location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}

fastcgi_pass unix:/var/run/php-example.com.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}

error_page 403 /error/404.html;
error_page 404 /error/404.html;
error_page 500 502 503 504 /error/50x.html;

location /error/ {
alias /home/admin/web/example.com/document_errors/;
}

location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}

location /vstats/ {
alias /home/admin/web/example.com/stats/;
include /home/admin/conf/web/example.com.auth*;
}

include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;

include /home/admin/conf/web/snginx.example.com.conf*;

location ~ "/uploads/.*\.php$|/templates/.*\.php$|/language/.*\.php$|/images/.*\.php$"
{
return 403;
}
location ~* (uploads|uploads/fotos|templates|language)/.+\.php {
deny all;
}
location ~* /templates/.+\.tpl {
deny all;
}
location ~* (engine/cache|engine/data) {
deny all;
}
location ~ /\.ht {
deny all;
}
}

nginx config

# Server globals
user nginx;
worker_processes auto;
worker_rlimit_nofile 65535;
error_log /var/log/nginx/error.log crit;
pid /var/run/nginx.pid;


# Worker config
events {
worker_connections 1024;
use epoll;
multi_accept on;
}


http {
# Main settings
sendfile on;
#tcp_nopush on;
#tcp_nodelay on;
client_header_timeout 1m;
client_body_timeout 1m;
client_header_buffer_size 2k;
client_body_buffer_size 256k;
client_max_body_size 256m;
large_client_header_buffers 4 8k;
send_timeout 30;
keepalive_timeout 60 60;
reset_timedout_connection on;
server_tokens off;
server_name_in_redirect off;
types_hash_max_size 2048;
variables_hash_max_size 1024;
variables_hash_bucket_size 128;


# Log format
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format bytes '$body_bytes_sent';
#access_log /var/log/nginx/access.log main;
access_log off;


# Mime settings
include /etc/nginx/mime.types;
default_type application/octet-stream;


# Compression
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_min_length 512;
gzip_buffers 8 64k;
gzip_proxied any;
gzip_disable "MSIE [1-6]\.";
gzip_types text/plain text/css text/javascript text/js text/xml application/json application/javascript application/x-javascript application/xml application/xml+rss application/x-font-ttf image/svg+xml font/opentype text/x-component text/x-cross-domain-policy;


# Proxy settings
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;


# SSL PCI Compliance
ssl_protocols TLSv1.2 TLSv1.3;
ssl_session_cache shared:SSL:10m;
ssl_ciphers TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:ECDHE:!COMPLEMENTOFDEFAULT;


# Error pages
error_page 403 /error/403.html;
error_page 404 /error/404.html;
error_page 502 503 504 /error/50x.html;


# Cache settings
proxy_cache_path /var/cache/nginx levels=2 keys_zone=cache:10m inactive=60m max_size=1024m;
proxy_cache_key "$host$request_uri $cookie_user";
proxy_temp_path /var/cache/nginx/temp;
proxy_ignore_headers Expires Cache-Control;
proxy_cache_use_stale error timeout invalid_header http_502;
proxy_cache_valid any 1d;


# FastCgi Cache
fastcgi_buffers 8 256k;
fastcgi_buffer_size 256k;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
fastcgi_cache_path /tmp/nginx_cache levels=1:2 keys_zone=fastcgicache:10m max_size=1024m inactive=1h;


# File cache settings
open_file_cache max=10000 inactive=30s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors off;


# Wildcard include
include /etc/nginx/conf.d/*.conf;


}
Subject Author Posted

Почему http3 удаляет домен из всех ссылок?

sneiks January 31, 2023 02:07PM

Re: Почему http3 удаляет домен из всех ссылок?

sneiks February 03, 2023 02:35AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 106
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