default.conf 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. upstream app{
  2. server app:5173;
  3. }
  4. server {
  5. listen 80 default_server;
  6. # root /var/www/html/api/src/web;
  7. # root /var/www/html/app/dist;
  8. index index.html index.php;
  9. server_name *.ouatterrir.fr;
  10. charset utf-8;
  11. location / {
  12. proxy_set_header X-Real-IP $remote_addr;
  13. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  14. proxy_set_header Host $http_host;
  15. proxy_set_header X-NginX-Proxy true;
  16. proxy_set_header X-Ssl on;
  17. proxy_cache off;
  18. proxy_buffering off;
  19. proxy_pass http://app;
  20. proxy_redirect off;
  21. }
  22. # https://serversforhackers.com/c/nginx-php-in-subdirectory
  23. location @api {
  24. rewrite ^/api/(.*)$ /api/index.php;
  25. }
  26. location /api {
  27. # rewrite /api/(.*)$ /$1 break;
  28. # root /var/www/html/api/src/web;
  29. alias /var/www/html/api/src/web/;
  30. # index index.php;
  31. # try_files $uri $uri/ /index.php?$query_string;
  32. try_files $uri $uri/ @api;
  33. error_log /var/log/nginx/api-error.log debug;
  34. location ~ \.php$ {
  35. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  36. fastcgi_pass api:9000;
  37. fastcgi_index index.php;
  38. include fastcgi_params;
  39. fastcgi_param SCRIPT_FILENAME $request_filename;
  40. fastcgi_intercept_errors off;
  41. fastcgi_buffer_size 16k;
  42. fastcgi_buffers 4 16k;
  43. fastcgi_read_timeout 150;
  44. }
  45. }
  46. location = /favicon.ico { access_log off; log_not_found off; }
  47. location = /robots.txt { access_log off; log_not_found off; }
  48. access_log on;
  49. error_log /var/log/nginx/app-error.log error;
  50. sendfile off;
  51. client_max_body_size 100m;
  52. # location ~ \.php$ {
  53. # fastcgi_split_path_info ^(.+\.php)(/.+)$;
  54. # fastcgi_pass api:9000;
  55. # fastcgi_index index.php;
  56. # include fastcgi_params;
  57. # fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  58. # fastcgi_intercept_errors off;
  59. # fastcgi_buffer_size 16k;
  60. # fastcgi_buffers 4 16k;
  61. # fastcgi_read_timeout 150;
  62. # }
  63. location ~ /\.ht {
  64. deny all;
  65. }
  66. }