Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation Error, 502 Bad Gateway, from page /install/index.php #217

Open
Vander-Bilt opened this issue Nov 10, 2024 · 1 comment
Open

Comments

@Vander-Bilt
Copy link

I followed the installation document https://docs.vvveb.com/installation / setting up nginx & php, trying to access localhost:8080, then got below error:
image

It can be seen that the error occurred on the /install/index.php page.

My development environment is as follows.

php

image

image

nginx

#user  nobody;
worker_processes  1;


error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {

    fastcgi_cache_path /var/run/nginx-vvveb_cache levels=1:2 keys_zone=VCACHE:100m inactive=30m;
    fastcgi_cache_key "$scheme$request_method$host$request_uri";
    fastcgi_cache_use_stale error timeout invalid_header http_500;

    #sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    #keepalive_timeout  65;

    #gzip  on;

    server {
        listen       0.0.0.0:8080;
        server_name  localhost;

        #root html;
        root /usr/local/var/vvveb/public;
        index index.php index.html index.htm;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

    
        gzip on;
        gzip_vary on;
        gzip_min_length 10240;
        gzip_proxied any;
        gzip_comp_level 6;
        gzip_buffers 16 8k;
        gzip_http_version 1.1;
        gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        #charset utf-8;

        add_header X-Frame-Options "SAMEORIGIN";
        add_header X-XSS-Protection "1; mode=block";
        add_header X-Content-Type-Options "nosniff";

        set $skip_cache 0;
        set $cache_uri $request_uri;


        if ($query_string != "") {
            set $skip_cache 1;
            set $cache_uri null;
        }

        # Don't cache uris containing the following segments
        if ($request_uri ~* "/admin/|/user/|/cart/|/feed/|index.php|sitemap(_index)?.xml") {
            set $skip_cache 1;
            set $cache_uri null;
        }  

        # Don't use the cache for logged in users or if products in cart
        if ($http_cookie ~* "nocache|user|cart") {
            set $skip_cache 1;
            set $cache_uri null;
        }

        # POST requests and urls with a query string should always go to PHP
        if ($request_method = POST) {
            set $skip_cache 1;
            set $cache_uri null;
        }

        #add domain to sitemaps for multisite
        location = /robots.txt {
            log_not_found off;
            access_log off;
            try_files $uri /index.php$is_args$args;
        }
        
        #static files	
        location ~* "\.(?!php)([\w]{3,5})$" {
            expires max;
            log_not_found off;
            sendfile           on;
            sendfile_max_chunk 1m;
            fastcgi_hide_header "Set-Cookie";
        }

        location / {
            #try_files $uri $uri/ =404;
            default_type  text/html;
            index index.php index.html index.htm;
            try_files /page-cache/$http_host$cache_uri /page-cache/$http_host$cache_uri/index.html $uri $uri/ /index.php$is_args$args;
            #try_files $uri $uri/ /index.php$is_args$args;

            #cache debug
            #add_header "uri" $cache_uri;
            #add_header "skip_cache" $skip_cache;
        }

        location ~ /media/.+?\.php$ {
            deny all;
        }

        location ~ \.php$ {
            include fastcgi.conf;
            fastcgi_pass 127.0.0.1:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

            fastcgi_intercept_errors        on;

            #uncomment fastcgi_cache to enable fastcgi cache, this should not be necessary
            #unless you set the path to a memory mapped location for even faster cache
            
            #fastcgi_cache VCACHE;          
            fastcgi_cache_bypass $skip_cache;
            fastcgi_no_cache $skip_cache;
            fastcgi_cache_valid 30m;
            #add_header X-VCache $upstream_cache_status;  
        }

        location ~ /\.(?!well-known).* {
            deny all;
        }
}

I found some error info in Nginx log, but I didn't know what led to it.

image

I tried to put a simple php file as test, it works well.

<?php 
phpinfo(); 
?>

image

@givanz
Copy link
Owner

givanz commented Nov 11, 2024

Can you also please check your php error log? this is probably caused by a php fatal error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants