Advertisement
Guest User

nginx.conf

a guest
Oct 14th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. user nginx;
  2. worker_processes auto;
  3. pid /run/nginx.pid;
  4.  
  5. include /usr/share/nginx/modules/*.conf;
  6.  
  7. events {
  8. worker_connections 1024;
  9. }
  10.  
  11. http {
  12. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  13. '$status $body_bytes_sent "$http_referer" '
  14. '"$http_user_agent" "$http_x_forwarded_for"';
  15. access_log /var/log/nginx/access.log main;
  16. error_log /var/log/nginx/error.log debug;
  17.  
  18. sendfile on;
  19. tcp_nopush on;
  20. tcp_nodelay on;
  21. keepalive_timeout 65;
  22. types_hash_max_size 2048;
  23.  
  24. include /etc/nginx/mime.types;
  25. default_type application/octet-stream;
  26.  
  27. include /etc/nginx/conf.d/*.conf;
  28.  
  29.  
  30. server {
  31. listen 80;
  32. server_name content-demo.sit.de;
  33. root /usr/share/nginx/html;
  34. index index.php index.html index.htm;
  35.  
  36.  
  37. location / {
  38. try_files $uri $uri/ =404;
  39. }
  40. error_page 404 /404.html;
  41. error_page 500 502 503 504 /50x.html;
  42. location = /50x.html {
  43. root /usr/share/nginx/html;
  44. }
  45.  
  46. location ~ \.php$ {
  47. try_files $uri =404;
  48. fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
  49. fastcgi_index index.php;
  50. include fastcgi_params;
  51. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  52. }
  53.  
  54.  
  55.  
  56. location ~* /(.git|cache|bin|logs|backups|tests)/.*$ { return 403; }
  57. location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
  58. location ~* /user/.*\.(txt|md|yaml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
  59. location ~ /(LICENSE.txt|composer.lock|composer.json|nginx.conf|web.config|htaccess.txt|\.htaccess) { return 403; }
  60. }
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement