nginx.conf.j2 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # https://laravel.com/docs/8.x/deployment#nginx
  2. server {
  3. listen 80;
  4. listen [::]:80;
  5. add_header X-Frame-Options "SAMEORIGIN";
  6. add_header X-Content-Type-Options "nosniff";
  7. gzip on;
  8. server_name {{ inventory_hostname }} {% for it in groups['zone'] %} {{ it }} {% endfor %};
  9. root {{ app_deploy_target }}/public;
  10. client_max_body_size 16M;
  11. index index.php;
  12. charset utf-8;
  13. access_log /var/log/nginx/{{ inventory_hostname }}.access.log;
  14. error_log /var/log/nginx/{{ inventory_hostname }}.error.log warn;
  15. location / {
  16. try_files $uri $uri/ /index.php?$query_string;
  17. }
  18. location = /favicon.ico {
  19. log_not_found off;
  20. }
  21. location = /robots.txt {
  22. log_not_found off;
  23. }
  24. error_page 404 /index.php;
  25. location ~ \.php$ {
  26. fastcgi_pass unix:/var/run/php/php{{ app_php_version }}-fpm.sock;
  27. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  28. include fastcgi_params;
  29. }
  30. location ~ /\.(?!well-known).* {
  31. deny all;
  32. }
  33. }