Advertisement
siprof

my nginx panther forum configuration

Sep 19th, 2016
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. server {
  2.  
  3. server_name example.com www.example.com;
  4.  
  5. access_log off;
  6. error_log /var/log/nginx/example.com.error.log;
  7.  
  8. root /var/www/example.com/htdocs;
  9.  
  10. index index.php index.html index.htm;
  11.  
  12. include /var/www/example.com/conf/nginx/*.conf;
  13. include lukas/cloudflare.conf;
  14. include lukas/ipjahat.conf;
  15. include lukas/httpheaderoke-panther.conf;
  16. include lukas/httpsheaderketat.conf;
  17. include lukas/ssl.dhparam.tickets.conf;
  18.  
  19. # Panther SECURITY.
  20. location ~ /(addons|attachments|cache|lang|plugins) {
  21. deny all;
  22. return 403;
  23. }
  24.  
  25. # Panther SEO FRIENDLY URLS.
  26. location / {
  27. if (!-e $request_filename){
  28. rewrite ^(.*)$ /include/rewrite.php last;
  29. }
  30. }
  31.  
  32. location ~ \.php$ {
  33. try_files $uri =404;
  34. include fastcgi_params;
  35. fastcgi_pass php7;
  36. }
  37.  
  38. # Security settings for better privacy
  39. # Deny hidden files
  40. location ~ /\.well-known {
  41. allow all;
  42. }
  43.  
  44. location ~ /\. {
  45. deny all;
  46. access_log off;
  47. log_not_found off;
  48. }
  49.  
  50. # Deny backup extensions & log files
  51. location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ {
  52. deny all;
  53. access_log off;
  54. log_not_found off;
  55. }
  56.  
  57. location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ {
  58. add_header "Access-Control-Allow-Origin" "*";
  59. access_log off;
  60. log_not_found off;
  61. expires max;
  62. }
  63.  
  64. location = /favicon.ico {
  65. access_log off;
  66. log_not_found off;
  67. expires max;
  68. }
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement