Welcome Guest, Not a member yet? Register   Sign In
double requests - validation messages not displayed

The problem is, my requests are doubled in production server (apache, shared hosting). The first response is correct, but the second is empty ie. without values passed. As result no validation error messages are displayed. The problem occurs only in production. I am not sure it does matter but I use parser templates for generating response. However I don't modify the response beside setting body to it.
Additionaly I receive the following errors after requests in hosting server error logs (it is probably related):

AH10157: FastCGI: An error happened during Fastcgi processing, fallback to CGI, referer: www.xxx.xx/xx
AH10144: FastCGI: comm with server "xxx xxx" aborted: error parsing headers: duplicate header 'Content-Type', referer: www.xxx.xx/xx

Has anyone any idea, what causes that problem and what could be a solution?

FuelPHP had a problem with fastcgi, this is their ,htaccess file save yours and try this one may help.
# Multiple Environment config, set this to development, staging or production
# SetEnv FUEL_ENV production

<IfModule mod_rewrite.c>

RewriteEngine on

# NOTICE: If you get a 404 play with combinations of the following commented out lines
#AllowOverride All
#RewriteBase /wherever/fuel/is

    # Make sure directory listing is disabled
Options +FollowSymLinks -Indexes

# Restrict your site to only one domain
# !important USE ONLY ONE OPTION

# Option 1: To rewrite "www.domain.com -> domain.com" uncomment the following lines.
#RewriteCond %{HTTPS} !=on
#RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
#RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

# Option 2: To rewrite "domain.com -> www.domain.com" uncomment the following lines.
#RewriteCond %{HTTPS} !=on
#RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
#RewriteCond %{HTTP_HOST} (.+)$ [NC]
#RewriteRule ^(.*)$ http://www.%1/$1 [R=301,L]

# Remove index.php from URL
#RewriteCond %{HTTP:X-Requested-With} !^XMLHttpRequest$
#RewriteCond %{THE_REQUEST} ^[^/]*/index\.php [NC]
#RewriteRule ^index\.php(.*)$ $1 [R=301,NS,L]

    # make HTTP Basic Authentication work on php-fcgi installs
    <IfModule mod_fcgid.c>
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Send request via index.php if not a real file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# deal with php-fcgi first
<IfModule mod_fcgid.c>
        RewriteRule ^(.*)$ index.php?/$1 [QSA,L]

# no php-fcgi, check for sapi and fpm
<IfModule !mod_fcgid.c>

# for PHP5 sapi installations
<IfModule mod_php5.c>
RewriteRule ^(.*)$ index.php/$1 [L]

<IfModule !mod_php5.c>

# for PHP7 sapi installations
<IfModule mod_php7.c>
RewriteRule ^(.*)$ index.php/$1 [L]

# for fpm installations
<IfModule !mod_php7.c>
RewriteRule ^(.*)$ index.php?/$1 [QSA,L]



What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

(This post was last modified: 05-31-2021, 05:52 AM by futureisnow.)

It didnt help. It looks like not FastCGI is the problem, but the sending headers OR content-type header twice by my application. It is strange because I logged it and locally it is only one request logged and indeed, in the production there are two requests (the first is correct and the second one is empty).

Theme © iAndrew 2016 - Forum software by © MyBB