Nginx показывает 404 в заголовке, несмотря на то, что страница рендеринг (Centos, Aapanel, Codeigniter 4)Php

Кемеровские программисты php общаются здесь
Ответить Пред. темаСлед. тема
Anonymous
 Nginx показывает 404 в заголовке, несмотря на то, что страница рендеринг (Centos, Aapanel, Codeigniter 4)

Сообщение Anonymous »

Я сталкиваюсь с странной проблемой, где страница
https://customportswears.com/ibc52/cust ... -gear.html
Загружает штраф в браузере, но при проверке с помощью Developer Tools или внешних услуг HTTT-Header IS 404. />Stack:
  • CentOS (aaPanel)
  • Nginx 1.24.0
  • PHP 8.3 (via PHP-FPM)
  • CodeIgniter 4
Current Nginx Configuration (Частично): < /p>
error_page 403 500 502 503 504 /index.php;
error_page 404 /404.php;

location = /404.php {
internal;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index 404.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location / {
try_files $uri $uri/ /index.php$is_args$args;
add_header Access-Control-Allow-Origin "*";
add_header Access-Control-Allow-Methods "GET, POST, OPTIONS";
add_header Access-Control-Allow-Headers "Content-Type, Authorization";
}

location ~ \.php$ {
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
} ```

What's Happening:
- The actual rendered page appears correct.
- However, HTTP response header for that URL is returning a 404 status.
- Suspect CodeIgniter or nginx config may be causing this, possibly due to try_files, error_page logic, or internal redirect conflicts.
Tried:
- Confirmed that the controller and route in CI4 return content properly.
- Double-checked the file path and route configs.
- Response status mismatch suggests a misconfiguration or forced status return.
Looking for insights from anyone who's handled similar 404 header issues with CodeIgniter and nginx under aaPanel. Could it be a CI4 header override after routing logic? Or does nginx misinterpret the fallback URL?
Any help is appreciated!


Подробнее здесь: https://stackoverflow.com/questions/796 ... nel-codeig
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Php»