0

Im trying to move a drupal site I started on my localhost to a server at home. The database is both exported from my localhost and stored on the server.

The content of the nginx.conf file is as follows

events {
worker_connections 768;
    # multi_accept on;
}

http{ 
    server {
        listen 443 ssl;

         ########  S S L    CONFIGURATIONS ##################
        ssl_certificate /etc/ssl/Nov2021/STAR_site.edu.co.crt;
        ssl_certificate_key /etc/ssl/Nov2021/site.edu.co.key;
        access_log /var/log/nginx/KNH_nginx.vhost.access.log;
        error_log /var/log/nginx/KNH_nginx.vhost.error.log;



        root /var/www/html/arctic_kittiwake;
        index index.php index.html index.htm;

    ###################################################
   
        server_name site.edu.co

        location / {
            #try_files $uri $uri/ /index.php?q=$uri&$args;
            try_files $uri /index.php?q=$uri$args;
        }

        location /site/ {
           if (!-e $request_filename){
               rewrite ^/site/(.*)$ /site/index.php break;
           }
        }

        location ~ \.php$ {
            fastcgi_index index.php;
        }

        location = /favicon.ico {
            log_not_found off;
            access_log off;
        }

        location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
        }

        location ~ /\. {
            deny all;
        }

        location ~* /(?:uploads|files)/.*\.php$ {
            deny all;
        }

    }
}

The directory where this file is stored is the /etc/nginx and the drupal site is stored in the /var/www/html/arctic_kittiwake/ directory.

I also have php7.4-fpm and mariadb-10.3 installed.

Samuel
  • 7
  • 4

1 Answers1

1

You are missing connection with php-fpm.

Example:

    # In Drupal 8, we must also match new paths where the '.php' appears in
    # the middle, such as update.php/selection. The rule we use is strict,
    # and only allows this pattern with the update.php front controller.
    # This allows legacy path aliases in the form of
    # blog/index.php/legacy-path to continue to route to Drupal nodes. If
    # you do not have any paths like that, then you might prefer to use a
    # laxer rule, such as:
    #   location ~ \.php(/|$) {
    # The laxer rule will continue to work if Drupal uses this new URL
    # pattern with front controllers other than update.php in a future
    # release.
    location ~ '\.php$|^/update.php' {
        fastcgi_split_path_info ^(.+?\.php)(|/.*)$;
        # Ensure the php file exists. Mitigates CVE-2019-11043
        try_files $fastcgi_script_name =404;
        # Security note: If you're running a version of PHP older than the
        # latest 5.3, you should have "cgi.fix_pathinfo = 0;" in php.ini.
        # See http://serverfault.com/q/627903/94922 for details.
        include fastcgi_params;
        # Block httpoxy attacks. See https://httpoxy.org/.
        fastcgi_param HTTP_PROXY "";
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_intercept_errors on;
        # PHP 5 socket location.
        #fastcgi_pass unix:/var/run/php5-fpm.sock;
        # PHP 7 socket location.
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
    }

Full example is here https://www.nginx.com/resources/wiki/start/topics/recipes/drupal/

Slot Gamer
  • 36
  • 2