nginx.conf 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. daemon off;
  2. worker_processes auto;
  3. pid /run/nginx.pid;
  4. error_log stderr;
  5. events {
  6. worker_connections 768;
  7. # multi_accept on;
  8. }
  9. http {
  10. ##
  11. # Basic Settings
  12. ##
  13. sendfile on;
  14. tcp_nopush on;
  15. tcp_nodelay on;
  16. keepalive_timeout 65;
  17. types_hash_max_size 2048;
  18. include /etc/nginx/mime.types;
  19. default_type application/octet-stream;
  20. client_body_temp_path /run/client_body;
  21. proxy_temp_path /run/proxy_temp;
  22. fastcgi_temp_path /run/fastcgi_temp;
  23. scgi_temp_path /run/scgi_temp;
  24. uwsgi_temp_path /run/uwsgi_temp;
  25. ##
  26. # Logging Settings
  27. ##
  28. access_log /dev/stdout;
  29. ##
  30. # Gzip Settings
  31. ##
  32. gzip on;
  33. gzip_disable "msie6";
  34. ##
  35. # Virtual Host Configs
  36. ##
  37. server {
  38. listen 8000;
  39. server_name ##APP_DOMAIN##;
  40. large_client_header_buffers 4 32k;
  41. client_max_body_size 50M;
  42. charset utf-8;
  43. # Frontend
  44. location / {
  45. root /app/code/taiga-front-dist/dist/;
  46. try_files $uri $uri/ /index.html;
  47. }
  48. # Backend
  49. location /api {
  50. proxy_set_header Host $http_host;
  51. proxy_set_header X-Real-IP $remote_addr;
  52. proxy_set_header X-Scheme $scheme;
  53. proxy_set_header X-Forwarded-Proto $scheme;
  54. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  55. proxy_pass http://127.0.0.1:8001/api;
  56. proxy_redirect off;
  57. }
  58. # Django admin access (/admin/)
  59. location /admin {
  60. proxy_set_header Host $http_host;
  61. proxy_set_header X-Real-IP $remote_addr;
  62. proxy_set_header X-Scheme $scheme;
  63. proxy_set_header X-Forwarded-Proto $scheme;
  64. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  65. proxy_pass http://127.0.0.1:8001$request_uri;
  66. proxy_redirect off;
  67. }
  68. # Static files
  69. location /static {
  70. alias /app/code/taiga-back/static;
  71. }
  72. # Media files
  73. location /media {
  74. alias /app/code/taiga-back/media;
  75. }
  76. }
  77. }