What Causing This Error Proxy_Fcgi: Error] Ah01071: Got Error 'Primary Script Unknown'

I'm getting the proxy_fcgi:error] AH01071: Got error 'Primary script unknown' error very frequently. Can anyone tell me what causing this error. What I learned so far is Rewrite rule may cause this issue. But do not understand exactly what causing this issue. Following are my Rewrite rules:

<VirtualHost *:80>
    ServerName example.com
    ServerAlias 

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www

    <Directory /var/www/>
        Options -Indexes +FollowSymLinks -MultiViews
        AllowOverride None
        Require all granted

        # Setting rewrite rules
        RewriteEngine on
        RewriteBase /
   
        RewriteCond %{HTTPS} off [OR]       
        RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
        RewriteRule (.*)  [R=301,L]

        # Show 404 error if there is any slash after page name
        RewriteRule ^.+?\.(php|html?)/ - [L,R=404,NC]

        # Custom Directory Index Files
        DirectoryIndex index.php index.html
    </Directory>
</VirtualHost>


<IfModule mod_ssl.c>
<VirtualHost *:443>
    ServerName example.com
    ServerAlias 

    ServerAdmin webmaster@localhost
    DocumentRoot /var/www

    <Directory /var/www/>
        Options -Indexes +FollowSymLinks -MultiViews
        AllowOverride None
        Require all granted

        # Setting rewrite rules
        RewriteEngine on
        RewriteBase /

        RewriteCond %{HTTP_HOST} ^example.com$ [NC]
        RewriteRule (.*)  [R=301,L]
        
        # Show 404 error if there is any slash after page name
        RewriteRule ^.+?\.(php|html?)/ - [L,R=404,NC]

        # Custom Directory Index Files
        DirectoryIndex index.php index.html
    </Directory>

Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/
SSLCertificateKeyFile /etc/letsencrypt/live/
</VirtualHost>
</IfModule>
1
Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article