jhd Posted August 30, 2014 Share Posted August 30, 2014 Hello! I use the following settings for Prestahop 1.6.x sobre Nginx 1.6.0. It works well, but when I try to access the administration page I get a 404 page. Please can you help me solve this Thanks very much! Regards. server { listen 80; root /var/www/prestashop.com/public_html; # Make site accessible from http://localhost/ server_name prestashop.com www.prestashop.com; location / { index /index.php; rewrite ^/api/?(.*)$ /webservice/dispatcher.php?url=$1 last; rewrite ^/([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$1$2.jpg last; rewrite ^/([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$1$2$3.jpg last; rewrite ^/([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$1$2$3$4.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7.jpg last; rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$$ rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(-[_a-zA-Z0-9-]*)?/[_a-zA-Z0-9-]*.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$$ rewrite ^/c/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; rewrite ^/c/([a-zA-Z-]+)/[a-zA-Z0-9-]+.jpg$ /img/c/$1.jpg last; rewrite ^/([0-9]+)(-[_a-zA-Z0-9-]*)/[_a-zA-Z0-9-]*.jpg$ /img/c/$1$2.jpg last; # Enable joomla SEF URL's inside Nginx try_files $uri $uri/ /index.php?$args; } location = /favicon.ico { log_not_found off; access_log off; } location = /robots.txt { allow all; log_not_found off; access_log off; } # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac). location ~ /\. { deny all; access_log off; log_not_found off; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; # fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; include fastcgi_params; } } Link to comment Share on other sites More sharing options...
vekia Posted August 30, 2014 Share Posted August 30, 2014 moved to configuration section (you posted it at section related to SEO) you see 404 when you're trying to open ADMIN page or when you press log in ? 1 Link to comment Share on other sites More sharing options...
jhd Posted August 30, 2014 Author Share Posted August 30, 2014 moved to configuration section (you posted it at section related to SEO) you see 404 when you're trying to open ADMIN page or when you press log in ? Sorry. When I trying to open ADMIN page. Link to comment Share on other sites More sharing options...
vekia Posted August 30, 2014 Share Posted August 30, 2014 that's weird admin page doesnt use mod rewrite functions so it's not necessary to define mod rewrite rules for back office. it should work. are you sure that you're trying to open correct admin directory? 1 Link to comment Share on other sites More sharing options...
jhd Posted August 30, 2014 Author Share Posted August 30, 2014 (edited) I'm sure. Your know which is the table containing the flag to disable the SEO? Thanks very much PD: It happens on two prestashop 1.6.09 installations with the same configuration. Edited August 30, 2014 by jhd (see edit history) Link to comment Share on other sites More sharing options...
jhd Posted August 31, 2014 Author Share Posted August 31, 2014 (edited) Sorry, Please can someone help ? At least disable friendly url. PD: I upgraded Nginx from 1.6 to 1.7.1 in Ubuntu Server 14.04, but the problem persists. Edited August 31, 2014 by jhd (see edit history) Link to comment Share on other sites More sharing options...
jhd Posted September 6, 2014 Author Share Posted September 6, 2014 The problem was in the server block file of Nginx. The above configuration does not work very well. Best regards Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now