Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- example.com/store/my-funny-test-product.html or example.com/store/city/my-funny-test-product.html
- example.com/store/index.php/my-funny-test-product.html or example.com/store/index.php/city/my-funny-test-product.html
- location ~ ^/store/(.*) {
- rewrite ^/store/(.*)$ /store/index.php$1;
- }
- 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"
- ## The whole setup stays close with the magento recommendations
- ## http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento
- server {
- listen myip:80;
- server_name .example.com;
- root /var/www/mydomain/public_html;
- location / {
- index index.html index.php;
- try_files $uri $uri/ @handler;
- }
- ## here comes my rewrite stuff to remove index.php from the subfolder ##
- location ~ ^/store/(.*) {
- rewrite ^/store/(.*)$ /store/index.php$1;
- }
- ## followed by some deny rulesets not relevant here ##
- location @handler { ## Magento common front handler
- rewrite / /index.php;
- }
- location ~ .php/ { ## Forward paths like /js/index.php/x.js to relevant handler
- rewrite ^(.*.php)/ $1 last;
- }
- location ~ .php$ { ## Execute PHP scripts
- if (!-e $request_filename) { rewrite / /index.php last; } ## Catch 404s that try_files miss
- expires off; ## Do not cache dynamic content
- fastcgi_pass 127.0.0.1:9000;
- fastcgi_param HTTPS $fastcgi_https;
- fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
- fastcgi_param MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
- fastcgi_param MAGE_RUN_TYPE store;
- include fastcgi_params; ## See /etc/nginx/fastcgi_params
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement