onepage.conf 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. server {
  2. server_name onepage.sg.com.cn t.sg.com.cn kinfolk.sg.com.cn ok.sg.com.cn jm.sg.com.cn;
  3. listen 80;
  4. allow all;
  5. autoindex off;
  6. set $charset utf-8;
  7. charset $charset;
  8. set $rootdir /data/web/onepage/project;
  9. if ( $host ~* "^([^\.]+)\.sg\.com\.cn$" ) {
  10. set $project $1;
  11. }
  12. if ( $project ~* onepage ) {
  13. set $project sg;
  14. }
  15. set $rootdir $rootdir/$project;
  16. root $rootdir;
  17. index index.php index.html;
  18. rewrite ^/admin$ /index.php?c=admin_index last;
  19. rewrite ^/$ /index.php?c=index last;
  20. location = /kissy-versions.php {
  21. root /data/web/onepage/kissy;
  22. rewrite ^/kissy-versions.php$ /versions.js break;
  23. expires 10m;
  24. }
  25. location / {
  26. # First attempt to serve request as file, then
  27. # as directory, then fall back to displaying a 404.
  28. try_files $uri $uri/ =404;
  29. # Uncomment to enable naxsi on this location
  30. # include /etc/nginx/naxsi.rules
  31. }
  32. location ~ ^(.*)$ {
  33. # fastcgi_split_path_info ^(.+\.php)(/.+)$;
  34. # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  35. # With php5-cgi alone:
  36. #fastcgi_pass 127.0.0.1:9000;
  37. # With php5-fpm:
  38. fastcgi_param SCRIPT_FILENAME $document_root/index.php;
  39. fastcgi_pass unix:/var/run/php5-fpm.sock;
  40. fastcgi_index index.php;
  41. include onepage_fastcgi_params;
  42. }
  43. }
  44. server {
  45. listen 80;
  46. server_name opcdn.sg.com.cn;
  47. allow all;
  48. autoindex off;
  49. concat on;
  50. concat_max_files 40;
  51. location ^~ /k/ {
  52. root /data/web/onepage/kissy;
  53. rewrite ^/k/(.*)$ /$1 break;
  54. expires 30d;
  55. }
  56. location ^~ /public/ {
  57. add_header Access-Control-Allow-Origin *;
  58. root /data/web/onepage/kissy;
  59. expires 1h;
  60. }
  61. }