Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. example.com/store/my-funny-test-product.html or example.com/store/city/my-funny-test-product.html
  2.  
  3. example.com/store/index.php/my-funny-test-product.html or example.com/store/index.php/city/my-funny-test-product.html
  4.  
  5. location ~ ^/store/(.*) {
  6. rewrite ^/store/(.*)$ /store/index.php$1;
  7. }
  8.  
  9. 2014/11/22 [notice] 9611#0: *816 "^/store/(.*)$" matches "/store/index.phpindex.phpmy-funny-test-product.html", client: xxxx, server: xxx, request: "GET /store/my-funny-test-product.html?token=1234 HTTP/1.1", host: "xxxx"
  10.  
  11. ## The whole setup stays close with the magento recommendations
  12. ## http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento
  13.  
  14. server {
  15. listen myip:80;
  16. server_name .example.com;
  17.  
  18. root /var/www/mydomain/public_html;
  19.  
  20. location / {
  21. index index.html index.php;
  22. try_files $uri $uri/ @handler;
  23. }
  24.  
  25. ## here comes my rewrite stuff to remove index.php from the subfolder ##
  26. location ~ ^/store/(.*) {
  27. rewrite ^/store/(.*)$ /store/index.php$1;
  28. }
  29.  
  30. ## followed by some deny rulesets not relevant here ##
  31.  
  32. location @handler { ## Magento common front handler
  33. rewrite / /index.php;
  34. }
  35.  
  36. location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
  37. rewrite ^(.*.php)/ $1 last;
  38. }
  39.  
  40. location ~ .php$ { ## Execute PHP scripts
  41. if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
  42.  
  43. expires off; ## Do not cache dynamic content
  44. fastcgi_pass 127.0.0.1:9000;
  45. fastcgi_param HTTPS $fastcgi_https;
  46. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  47. fastcgi_param MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
  48. fastcgi_param MAGE_RUN_TYPE store;
  49. include fastcgi_params; ## See /etc/nginx/fastcgi_params
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement