Nginx - Auth login after installation not working?

#1

Hi there,

I have my managed to install cockpit by reading the documentation. After installing i’m redirected to /cockpit/auth/login on page load i see “{ERROR}” before entering the default username and password admin.

This is my nginx config: (p.s.: real domain replaced with “private”)

server {
    listen 443 ssl;
    server_name private.com www.private.com;
    root /var/www/web/private/;
    index index.php;

	# Charset
	charset utf-8;

	# SSL Settings
	ssl on;
	ssl_certificate /etc/nginx/ssl/private.pem;
	ssl_certificate_key /etc/nginx/ssl/private.key;

	# Access & Error logs.
	access_log /var/log/nginx/private_http_access.log combined;
	error_log /var/log/nginx/private_http_error.log;

	# set max upload size
	client_max_body_size 2G;
	fastcgi_buffers 64 4K;

    # Add additional types
    include mime.types;

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

    # Change "cockpit" to the folder name containing cockpit files.
    location /cockpit {
        try_files $uri $uri/ /cockpit/index.php?$args;
        index index.php index.html index.htm;
    }

    location ~* \.php$ {
        fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
        fastcgi_param COCKPIT_URL_REWRITE On;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
        include         fastcgi_params;
        fastcgi_index   index.php;
        fastcgi_param   SCRIPT_FILENAME     $document_root$fastcgi_script_name;
        fastcgi_param   SCRIPT_NAME         $fastcgi_script_name;
        fastcgi_param   PATH_INFO           $fastcgi_path_info;
		# fastcgi_param COCKPIT_URL_REWRITE On;
    }

    location ~ .sqlite$ {
        deny all;
    }
}

Can someone help? Why am i not able to login?

1 Like