You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.9 KiB

  1. # NGINX CONFIGURATION FOR COMMON LOCATION
  2. # DO NOT MODIFY, ALL CHANGES LOST AFTER UPDATE EasyEngine (ee)
  3. # Basic locations files
  4. location = /favicon.ico {
  5. access_log off;
  6. log_not_found off;
  7. expires max;
  8. }
  9. location = /robots.txt {
  10. # Some WordPress plugin gererate robots.txt file
  11. # Refer #340 issue
  12. try_files $uri $uri/ /index.php?$args;
  13. access_log off;
  14. log_not_found off;
  15. }
  16. # Cache static files
  17. location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf|webp)$ {
  18. add_header "Access-Control-Allow-Origin" "*";
  19. access_log off;
  20. log_not_found off;
  21. expires max;
  22. }
  23. # Cache static files
  24. location ~* \.(css|js)$ {
  25. add_header "Access-Control-Allow-Origin" "*";
  26. access_log off;
  27. log_not_found off;
  28. expires 30d;
  29. }
  30. # Security settings for better privacy
  31. # Deny hidden files
  32. location /.well-known/acme-challenge/ {
  33. alias /var/www/html/.well-known/acme-challenge/;
  34. }
  35. #location ~ /\.well-known {
  36. # allow all;
  37. #}
  38. location ~ /\. {
  39. deny all;
  40. access_log off;
  41. log_not_found off;
  42. }
  43. # Deny backup extensions & log files
  44. location ~* ^.+\.(bak|log|old|orig|original|php#|php~|php_bak|save|swo|swp|sql)$ {
  45. deny all;
  46. access_log off;
  47. log_not_found off;
  48. }
  49. # Return 403 forbidden for readme.(txt|html) or license.(txt|html) or example.(txt|html)
  50. location ~* "/(^$|readme|license|example)\.(txt|html)" {
  51. return 403;
  52. }
  53. # Status pages
  54. location /nginx_status {
  55. stub_status on;
  56. access_log off;
  57. include common/acl.conf;
  58. }
  59. location ~ ^/(status|ping) {
  60. include fastcgi_params;
  61. fastcgi_pass php7;
  62. include common/acl.conf;
  63. }
  64. # EasyEngine (ee) utilities
  65. # phpMyAdmin settings
  66. location /pma {
  67. return 301 https://$host:22222/db/pma;
  68. }
  69. location /phpMyAdmin {
  70. return 301 https://$host:22222/db/pma;
  71. }
  72. location /phpmyadmin {
  73. return 301 https://$host:22222/db/pma;
  74. }
  75. # Adminer settings
  76. location /adminer {
  77. return 301 https://$host:22222/db/adminer;
  78. }