Advertisement
Guest User

Untitled

a guest
Apr 4th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2. listen 127.0.0.1:80 default_server;
  3. #listen [::1]:80 ipv6only=on;
  4. server_name localhost;
  5. ###############REWRITE RULES######################
  6.  
  7.  
  8. location / {
  9.  
  10. if (!-e $request_filename){
  11.  
  12.  
  13. rewrite ^/office/([^/]*).css$ /t.php?gid=$1 last;
  14.  
  15. rewrite ^/u/([^/]+)/profile/?$ /user/$1/ permanent;
  16. rewrite ^/u/([^/]+)/rss/?$ /userrss.php?user=$1 last;
  17. rewrite ^/u/([^/]+)/rss/([a-zA-Z0-9-]+)/?$ /userrss.php?user=$1&status=$2 last;
  18. rewrite ^/u/([^/]+)/edit/?$ /profile.php?login=$1 last;
  19. rewrite ^/u/([^/]+)/([^/]+)/?$ /user.php?view=$2&login=$1 last;
  20. rewrite ^/u/?$ /user.php last;
  21. rewrite ^/u/([^/]+)/?$ /user.php?login=$1 last;
  22. rewrite ^/profile/?$ /profile.php last;
  23. }
  24.  
  25. if ($query_string ~* 'mosConfig_[a-zA-Z_]{1,21}(=|\%3D)' ){
  26. return 405;
  27. }
  28. if ($query_string ~* base64_encode.*\(.*\) ){
  29. return 405;
  30. }
  31. if ($query_string ~* (\<|%3C).*script.*(\>|%3E) ){
  32. return 405;
  33. }
  34. if ($query_string ~* 'GLOBALS(=|\[|\%[0-9A-Z]{0,2})' ){
  35. return 405;
  36. }
  37. if ($query_string ~* '_REQUEST(=|\[|\%[0-9A-Z]{0,2})' ){
  38. return 405;
  39. }
  40.  
  41. if ($http_user_agent ~* ^pycurl/){
  42. return 405;
  43. }
  44.  
  45.  
  46.  
  47.  
  48. }
  49.  
  50. #####END REWRITE################
  51.  
  52. location ~* \.(css|js|gif|jpeg|png|jpg)$ {
  53. expires 168h;
  54. add_header Pragma public;
  55. add_header Cache-Control "public, must-revalidate, proxy-revalidate";
  56. }
  57.  
  58. rewrite_log on;
  59.  
  60. root "c:/www/www/";
  61. autoindex on;
  62.  
  63. allow 127.0.0.1;
  64. #allow ::1;
  65. deny all;
  66.  
  67. # deny access to .htaccess files, if Apache's document root
  68. # concurs with nginx's one
  69. #
  70. location ~ /\.ht {
  71. deny all;
  72. }
  73.  
  74. location ~ \.php$ {
  75. try_files $uri =404;
  76. fastcgi_pass php_farm;
  77. include nginx.fastcgi.conf;
  78. }
  79.  
  80.  
  81.  
  82. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement