Advertisement
Guest User

Nginx Config

a guest
Jun 1st, 2012
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1.  
  2. server {
  3. listen xx.x.xxx.xxx:8089;
  4. #listen xxx.xxx.xx.xx:443 ssl;
  5.  
  6. #ssl on;
  7. #ssl_certificate /srv/www/sub.mydomain.dev/ssl/usshop.cabundle.cert;
  8. #ssl_certificate_key /srv/www/sub.mydomain.dev/ssl/us-shop_dubarryboots_us.key;
  9.  
  10. server_name sub.mydomain.dev; ## Domain is here twice so server_name_in_redirect will favour the www
  11. root /srv/www/sub.mydomain.dev/public_html;
  12.  
  13. #this wil rewrite none www to www
  14. if ($host = 'xx.x.xxx.xxx:8089' ) {
  15. rewrite ^/(.*)$ http://xx.x.xxx.xxx:8089/$1 ;
  16. }
  17. access_log /srv/www/sub.mydomain.dev/logs/access.log;
  18. error_log /srv/www/sub.mydomain.dev/logs/error.log;
  19.  
  20. location / {
  21. index index.html index.php; ## Allow a static html file to be shown first
  22. try_files $uri $uri/ @handler; ## If missing pass the URI to Magento's front handler
  23. #rewrite ^.+ /collections permanent;
  24. expires 30d; ## Assume all files are cachable
  25. }
  26. #location /minify/ { ## Needed for Fooman Speedster
  27. # rewrite ^/minify/([0-9]+)(/.*\.(js|css))$ /lib/minify/m.php?f=$2&d;=$1 last;
  28. #}
  29.  
  30. ## These locations would be hidden by .htaccess normally
  31. location /app/ { deny all; }
  32. location /includes/ { deny all; }
  33. location /lib/ { deny all; }
  34. location /lib/minify/ { allow all; } ## Deny is applied after rewrites so must specifically allow minify
  35. location /media/downloadable/ { deny all; }
  36. location /pkginfo/ { deny all; }
  37. location /report/config.xml { deny all; }
  38. location /var/ { deny all; }
  39.  
  40. location /var/export/ { ## Allow admins only to view export folder
  41. auth_basic "Restricted"; ## Message shown in login window
  42. auth_basic_user_file htpasswd; ## See /etc/nginx/htpassword
  43. autoindex on;
  44. }
  45.  
  46. location /. { ## Disable .htaccess and other hidden files
  47. return 404;
  48. }
  49.  
  50. #location / {
  51. # rewrite ^.+ /collections;
  52. # }
  53.  
  54. location @handler { ## Magento uses a common front handler
  55. rewrite / /index.php;
  56. }
  57.  
  58. location ~ \.php/ { ## Forward paths like /js/index.php/x.js to relevant handler
  59. rewrite ^(.*\.php)/ $1 last;
  60. }
  61.  
  62. location ~ \.php$ { ## Execute PHP scripts
  63. expires off; ## Do not cache dynamic content
  64. fastcgi_param HTTPS on;
  65. fastcgi_param HTTPS True;
  66. fastcgi_pass 127.0.0.1:9000;
  67. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  68. include fastcgi_params; ## See /etc/nginx/fastcgi_params
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement