【问题标题】:Nginx Problem with Joomla Backend (Cloudflare Error 520)Joomla 后端的 Nginx 问题(Cloudflare 错误 520)
【发布时间】:2022-01-26 12:11:22
【问题描述】:

大家好!

我很难弄清楚这一点,当我使用 apache 运行我的网站时,一切正常,但是我最近切换到 nginx,当我在 nginx 上运行我的网站并访问 joomla 后端时,我得到了一个来自 Cloudflare 的错误 520,我无法找出两个网络服务器的区别,但它似乎与 SSL 有关,在没有 SSL 的情况下运行可以正常工作。 我不走运,我做了很多测试,但仍然是同样的问题。 使用 Nginx 时发生了 Cloudflare 无法理解的事情。

这是我的 Nginx 配置

 server {
        
        listen 443 ssl http2;
        listen 80;
        
        server_name websitename.com www.websitename.com;
        
        root  /var/www/html;
    
        ssl_certificate websitename.com.crt;
        ssl_certificate_key websitename.com.key;
        
            index index.php index.html index.htm default.html default.htm;

             location / {
                    try_files $uri $uri/ /index.php?$args;
            }
    

            location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
                    return 403;
                    error_page 403 /403_error.html;
            }
    
            location ~ \.php$ {
                fastcgi_pass  127.0.0.1:9000;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include /etc/nginx/fastcgi.conf;
            }
    

            location ~* \.(ico|pdf|flv)$ {
                    expires 1y;
            }
    
            location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
                    expires 14d;
            }
            
    }

【问题讨论】:

  • 我什至试过这个东西 client_header_buffer_size 64k; large_client_header_buffers 4 64k; http2_max_field_size 64k;请发送帮助
  • 如果您是 Joomla 用户或开发者,请加入Joomla Stack Exchange。

标签: nginx server


【解决方案1】:

我终于解决了。

最后我发现 Cloudflare Railgun 与 Nginx 的行为不正确

我去了 Cloudflare 并导航到“速度->优化”我禁用了 Railgun 而且我不再有 520 错误。

希望这对遇到相同问题的任何人有所帮助,在此问题上停留了 3 天。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-13
    • 2019-02-03
    • 1970-01-01
    • 1970-01-01
    • 2012-09-25
    相关资源
    最近更新 更多