Jump to content

Redirect Loop in fresh Presta Shop Install


Recommended Posts

Hello,

I set up (following online guides) Ubuntu 18.04, php7.2, nginx and mysql to use with PrestaShop 1.7.6.2

I set ssl using Let'sEncrypt

I obtained required files, domains are redirected. Installation of PrestaShop went smoothly.

 

After installation I can log into Back Office without any problem.

 

While inside of Back Office, I cant select any option from left menu - it loads page with domain/index.php and browsers are reporting redirect loops error.

 

I see a lot of topics about it over internet, but most of them are solved by "go into seo and change xxx".

 

But I can't go anywhere inside of my BO.

 

Can anybody help me with this issue?

# Redirect HTTP -> HTTPS
server {
    listen 80;
    listen [::]:80;
    server_name www.domain.com domain.com;


    include snippets/letsencrypt.conf;
    return 302 https://$server_name$request_uri;

}

# Redirect WWW -> NON WWW
server {

	listen 443 ssl http2;
	server_name www.domain.com;

	ssl_certificate /etc/letsencrypt/live/www.domain.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/www.domain.com/privkey.pem;
	ssl_trusted_certificate /etc/letsencrypt/live/www.domain.com/chain.pem;
	include snippets/ssl.conf;	


	
}

server {

	listen 443 ssl http2;
	server_name domain.com;
	root /var/www/html/domain;	

	index index.php;

	set $admin_dir /adminPanogO;


	#SSL PARAMS
	ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
	ssl_trusted_certificate /etc/letsencrypt/live/domain.com/chain.pem;
	include snippets/ssl.conf;
	include snippets/letsencrypt.conf;

	#LOGS
     	access_log /var/log/nginx/domain.com.access.log;
   	error_log /var/log/nginx/domain.com.error.log;



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


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

	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
		fastcgi_pass unix:/run/php/php7.2-fpm.sock;
	}
	
	location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
		expires max;
		log_not_found off;
	}
}

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...