HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=27)
-   -   Ispconfig 3 + nginx + prestashop rewrite = 500 Internal Server Error (http://www.howtoforge.com/forums/showthread.php?t=62265)

hitri 18th June 2013 10:07

Ispconfig 3 + nginx + prestashop rewrite = 500 Internal Server Error
 
I'm using Ubuntu server 12.04LTS, nginx web server with Ispconfig 3 (The perfect server installation). I have installed Prestashop and when I turn on the rewrite function I got '500 Internal Server Error' (URL looks ok). I was looking for solution on all forums nothing works for me. Nginx looks like nightmare.

ItsDom 19th June 2013 10:25

Is there anything in the log files (access.log, error.log or php-fpm.log?)

I've found with nginx, to get rewrite stuff working, you tend to have to set some nginx directives.

You may have already seen this, but I'll post it just in case:
http://www.howtoforge.com/running-pr...y-ubuntu-12.10

hitri 19th June 2013 10:36

I've seen this set up. It is not useful for Ispconfig configuration. I used only those nginx rewritw directives.

ItsDom 19th June 2013 10:46

Okay. Is there anything in your log files?

The part which handles the redirects in that guide is:

Code:

try_files $uri $uri/ /index.php$is_args$args;
Make sure you set the directives through nginx (see example here http://www.howtoforge.com/forums/sho...14&postcount=4) and not by modifying the vhosts file as ISPConfig will overwrite it.

hitri 19th June 2013 14:05

Thank you ItsDom.

You are right, ispconfig rewrite directives in vhost configurations.

Now it works, but images are not visible :confused:

ItsDom 19th June 2013 15:09

No worries.

Looking at the nginx directive from the tutorial, I'm guessing the bit to handle images is:

Code:

      rewrite ^/([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$1$2$3.jpg last;
      rewrite ^/([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$1$2$3$4.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$1$2$3$4$5.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$1$2$3$4$5$6.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$1$2$3$4$5$6$7.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$1$2$3$4$5$6$7$8.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$1$2$3$4$5$6$7$8$9.jpg last;
      rewrite ^/([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])([0-9])(\-[_a-zA-Z0-9-]*)?(-[0-9]+)?/.+\.jpg$ /img/p/$1/$2/$3/$4/$5/$6/$7/$8/$1$2$3$4$5$6$7$8$9$10.jpg last;
      rewrite ^/c/([0-9]+)(\-[\.*_a-zA-Z0-9-]*)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2$3.jpg last;
      rewrite ^/c/([a-zA-Z_-]+)(-[0-9]+)?/.+\.jpg$ /img/c/$1$2.jpg last;
      rewrite ^/images_ie/?([^/]+)\.(jpe?g|png|gif)$ /js/jquery/plugins/fancybox/images/$1.$2 last;

I could be wrong though - give it a try.

If other bits still don't work, e.g. the API, have a look through the nginx directives given in the tutorial and transplant the bits you need into the "nginx directives" box in site options in ISPConfig.

I'm not sure if the stuff above needs to go into a location container. I imagine not. Try it outside of the location container and if it throws up some errors, then put it in with the index directive.

hitri 19th June 2013 16:14

ItsDom thank you very much, it works now :)


All times are GMT +2. The time now is 05:52.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.