site.conf 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. server {
  2. server_name local.new.api.opentalent.fr;
  3. root /var/www/html/public;
  4. location / {
  5. add_header 'Access-Control-Allow-Origin' '*';
  6. # try to serve file directly, fallback to index.php
  7. try_files $uri /index.php$is_args$args;
  8. }
  9. # optionally disable falling back to PHP script for the asset directories;
  10. # nginx will return a 404 error when files are not found instead of passing the
  11. # request to Symfony (improves performance but Symfony's 404 page is not displayed)
  12. # location /bundles {
  13. # try_files $uri =404;
  14. # }
  15. location ~ ^/index\.php(/|$) {
  16. fastcgi_pass php74:9000;
  17. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  18. include fastcgi_params;
  19. # optionally set the value of the environment variables used in the application
  20. # fastcgi_param APP_ENV prod;
  21. # fastcgi_param APP_SECRET <app-secret-id>;
  22. # fastcgi_param DATABASE_URL "mysql://db_user:db_pass@host:3306/db_name";
  23. # When you are using symlinks to link the document root to the
  24. # current version of your application, you should pass the real
  25. # application path instead of the path to the symlink to PHP
  26. # FPM.
  27. # Otherwise, PHP's OPcache may not properly detect changes to
  28. # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
  29. # for more information).
  30. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  31. fastcgi_param DOCUMENT_ROOT $realpath_root;
  32. # Prevents URIs that include the front controller. This will 404:
  33. # http://domain.tld/index.php/some-path
  34. # Remove the internal directive to allow URIs like this
  35. internal;
  36. }
  37. # return 404 for all other php files not matching the front controller
  38. # this prevents access to other php files you don't want to be accessible.
  39. location ~ \.php$ {
  40. return 404;
  41. }
  42. error_log /var/log/nginx/project_error.log;
  43. access_log /var/log/nginx/project_access.log;
  44. }
  45. server {
  46. server_name local.api.opentalent.fr;
  47. root /var/www/html/web;
  48. location / {
  49. add_header 'Access-Control-Allow-Origin' '*';
  50. # try to serve file directly, fallback to app.php
  51. try_files $uri /app_dev.php$is_args$args;
  52. http2_push_preload on;
  53. }
  54. # DEV
  55. # This rule should only be placed on your development environment
  56. # In production, don't include this and don't deploy app_dev.php or config.php
  57. location ~ ^/(app_dev|config)\.php(/|$) {
  58. fastcgi_pass php70:9000;
  59. fastcgi_split_path_info ^(.+\.php)(/.*)$;
  60. include fastcgi_params;
  61. # When you are using symlinks to link the document root to the
  62. # current version of your application, you should pass the real
  63. # application path instead of the path to the symlink to PHP
  64. # FPM.
  65. # Otherwise, PHP's OPcache may not properly detect changes to
  66. # your PHP files (see https://github.com/zendtech/ZendOptimizerPlus/issues/126
  67. # for more information).
  68. fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
  69. fastcgi_param DOCUMENT_ROOT $realpath_root;
  70. proxy_read_timeout 6000;
  71. http2_push_preload on;
  72. }
  73. # return 404 for all other php files not matching the front controller
  74. # this prevents access to other php files you don't want to be accessible.
  75. location ~ \.php$ {
  76. return 404;
  77. }
  78. }