Advertisement
Guest User

Untitled

a guest
Feb 20th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. server {
  2. listen 80; ## listen for ipv4; this line is default and implied
  3. listen [::]:80 default ipv6only=on; ## listen for ipv6
  4.  
  5. root /usr/share/nginx/html;
  6. index index.php index.html index.htm;
  7.  
  8. # Make site accessible from http://localhost/
  9. server_name _;
  10.  
  11. # Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
  12. sendfile off;
  13.  
  14. # Security - Hide nginx version number in error pages and Server header
  15. server_tokens off;
  16.  
  17. # Add stdout logging
  18. error_log /dev/stdout info;
  19. access_log /dev/stdout;
  20.  
  21. # reduce the data that needs to be sent over network
  22. gzip on;
  23. gzip_min_length 10240;
  24. gzip_proxied expired no-cache no-store private auth;
  25. gzip_types text/plain text/css text/xml application/json text/javascript application/x-javascript application/xml;
  26. gzip_disable "MSIE [1-6]\.";
  27.  
  28. location / {
  29. # First attempt to serve request as file, then
  30. # as directory, then fall back to index.html
  31. #try_files $uri $uri/ =404;
  32. try_files $uri $uri/ /index.php?$args;
  33. }
  34.  
  35. # redirect server error pages to the static page /50x.html
  36. #
  37. error_page 500 502 503 504 /50x.html;
  38. location = /50x.html {
  39. root /usr/share/nginx/html;
  40. }
  41.  
  42. # pass the PHP scripts to FastCGI server listening on socket
  43. #
  44. location ~ \.php$ {
  45. try_files $uri =404;
  46. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  47. fastcgi_pass unix:/run/php/php7.4-fpm.sock;
  48. fastcgi_index index.php;
  49. include fastcgi_params;
  50. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  51. fastcgi_param PATH_INFO $fastcgi_path_info;
  52. }
  53.  
  54. location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
  55. expires 5d;
  56. }
  57.  
  58. # deny access to . files, for security
  59. #
  60. location ~ /\. {
  61. log_not_found off;
  62. deny all;
  63. }
  64.  
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement