RajkumarRK

Untitled

Aug 29th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. server {
  2. listen 80 default;
  3. ## SSL directives might go here
  4. server_name www.chennaihousing.com; ## Domain is here twice so server_name_in_redirect will favour the www
  5. root /var/www/html/magento2;
  6.  
  7. location / {
  8. index index.html index.php; ## Allow a static html file to be shown first
  9. try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
  10. expires 30d; ## Assume all files are cachable
  11. }
  12.  
  13. ## These locations would be hidden by .htaccess normally
  14. location ^~ /app/ { deny all; }
  15. location ^~ /includes/ { deny all; }
  16. location ^~ /lib/ { deny all; }
  17. location ^~ /media/downloadable/ { deny all; }
  18. location ^~ /pkginfo/ { deny all; }
  19. location ^~ /report/config.xml { deny all; }
  20. location ^~ /var/ { deny all; }
  21.  
  22. location /var/export/ { ## Allow admins only to view export folder
  23. auth_basic "Restricted"; ## Message shown in login window
  24. auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
  25. autoindex on;
  26. }
  27.  
  28. location /. { ## Disable .htaccess and other hidden files
  29. return 404;
  30. }
  31.  
  32. location @handler { ## Magento uses a 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 192.168.56.10:9000;
  45. # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  46. # fastcgi_param MAGE_RUN_CODE default; ## Store code is defined in administration > Configuration > Manage Stores
  47. # fastcgi_param MAGE_RUN_TYPE store;
  48. # include fastcgi_params; ## See /etc/nginx/fastcgi_params
  49. # }
  50. }
Add Comment
Please, Sign In to add comment