Advertisement
Guest User

Untitled

a guest
Sep 18th, 2014
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.60 KB | None | 0 0
  1. Options +FollowSymLinks
  2. RewriteEngine On
  3. RewriteRule ^img-(.*).html img.php?id=$1 [L]
  4. RewriteRule ^slide-(.*).html slider.php?id=$1 [L]
  5. RewriteRule ^page-(.*).html page.php?name=$1 [L]
  6. RewriteRule ^contact.html$ contact.php [QSA,L,NC]
  7.  
  8. RewriteEngine On
  9. RewriteCond %{HTTP_REFERER} !^http://(.+.)?foo.com/ [NC]
  10. RewriteCond %{HTTP_REFERER} !^$
  11. RewriteRule .*.(jpe?g|gif|bmp|png)$ nohotlink.gif [L]
  12. <Files ~ ".(php|sql|php3|php4|phtml|pl|py|jsp|asp|htm|shtml|sh|cgi)$">
  13. order allow,deny
  14. deny from all
  15. </Files>
  16.  
  17. RewriteEngine Off
  18.  
  19. # nginx configuration
  20.  
  21. location /img {
  22. rewrite ^/img-(.*).html /img.php?id=$1 break;
  23. }
  24. location /slide {
  25. rewrite ^/slide-(.*).html /slider.php?id=$1 break;
  26. }
  27. location /page {
  28. rewrite ^/page-(.*).html /page.php?name=$1 break;
  29. }
  30. location /contact {
  31. rewrite ^/contact.html$ /contact.php break;
  32. }
  33.  
  34. # nginx configuration
  35.  
  36. location /upload {
  37. if ($http_referer !~ "^http://(.+.)?foo.com/"){
  38. rewrite .*.(jpe?g|gif|bmp|png)$ /nohotlink.gif break;
  39. }
  40. }
  41. location ~ .(php|sql|php3|php4|phtml|pl|py|jsp|asp|htm|shtml|sh|cgi)$ {
  42. deny all;
  43. }
  44.  
  45. # nginx configuration
  46.  
  47. location /upload/small {
  48. }
  49.  
  50. location / {
  51. try_files $uri $uri/ /index.php;
  52. include /etc/nginx/includes/root.access;
  53. }
  54.  
  55. location /upload {
  56. include /etc/nginx/includes/upload.access;
  57. }
  58.  
  59. location /upload/small {
  60. include /etc/nginx/includes/small.access;
  61. }
  62.  
  63. [error] 18156#0: *7 access forbidden by rule, client: 111.**.**.**, server: foo.com, request: "POST /upload.php HTTP/1.1", host: "foo.com", referrer: "http://foo.com/"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement