Advertisement
apurvasukant

nginx-site.conf

Oct 19th, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. server {
  2. # listen 443;
  3. listen 80;
  4. server_name www.mydomain.com;
  5. root /usr/share/nginx/www;
  6. index index.php;
  7.  
  8. #SSL Configuration
  9. #ssl on;
  10. #ssl_certificate /etc/ssl/ssl.crt;
  11. #ssl_certificate_key /etc/ssl/ssl.key;
  12. #ssl_protocols SSLv3 TLSv1;
  13. #ssl_ciphers ALL:!aNULL:!ADH:!eNULL:!LOW:!EXP:RC4+RSA:+HIGH:+MEDIUM;
  14.  
  15. #ssl_session_cache shared:SSL:15m;
  16. #ssl_session_timeout 15m;
  17. #ssl_verify_depth 3;
  18.  
  19. location / {
  20. try_files $uri $uri/ /index.php?q=$uri&$args; #SEF URL
  21. }
  22.  
  23. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  24.  
  25. location ~ \.php$ {
  26. fastcgi_pass localhost:9000;
  27. fastcgi_index index.php;
  28.  
  29. #fastcgi_param HTTPS on;
  30. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  31.  
  32. include fastcgi_params;
  33. }
  34.  
  35. # deny running scripts inside writable directories
  36. location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ {
  37. return 403;
  38. error_page 403 /403_error.html;
  39. }
  40.  
  41. # caching of files
  42. location ~* \.(ico|pdf|flv)$ {
  43. expires 1y;
  44. }
  45.  
  46. location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ {
  47. expires 15d;
  48. }
  49. }
  50.  
  51. server {
  52. server_name mydomain.com;
  53. listen 80;
  54. return 301 http://www.mydomain.com$request_uri;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement