Advertisement
aivavic

config server

Jul 29th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.33 KB | None | 0 0
  1. ## FRONTEND ##
  2. server {
  3. listen 80 default;
  4.  
  5. root /app/frontend/web;
  6. index index.php index.html;
  7.  
  8. server_name dolist.dev;
  9.  
  10. charset utf-8;
  11.  
  12. # location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ {
  13. # access_log off;
  14. # expires max;
  15. # }
  16.  
  17. location / {
  18. try_files $uri $uri/ /index.php?$args;
  19. }
  20.  
  21. client_max_body_size 32m;
  22.  
  23. # There is a VirtualBox bug related to sendfile that can lead to
  24. # corrupted files, if not turned-off
  25. # sendfile off;
  26.  
  27. location ~ \.php$ {
  28. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  29. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  30. fastcgi_pass php-fpm;
  31. fastcgi_index index.php;
  32. include fastcgi_params;
  33.  
  34. ## Cache
  35. # fastcgi_pass_header Cookie; # fill cookie valiables, $cookie_phpsessid for exmaple
  36. # fastcgi_ignore_headers Cache-Control Expires Set-Cookie; # Use it with caution because it is cause SEO problems
  37. # fastcgi_cache_key "$request_method|$server_addr:$server_port$request_uri|$cookie_phpsessid"; # generating unique key
  38. # fastcgi_cache fastcgi_cache; # use fastcgi_cache keys_zone
  39. # fastcgi_cache_path /tmp/nginx/ levels=1:2 keys_zone=fastcgi_cache:16m max_size=256m inactive=1d;
  40. # fastcgi_temp_path /tmp/nginx/temp 1 2; # temp files folder
  41. # fastcgi_cache_use_stale updating error timeout invalid_header http_500; # show cached page if error (even if it is outdated)
  42. # fastcgi_cache_valid 200 404 10s; # cache lifetime for 200 404;
  43. # or fastcgi_cache_valid any 10s; # use it if you want to cache any responses
  44. }
  45. }
  46.  
  47. ## BACKEND ##
  48. server {
  49. listen 80;
  50.  
  51. root /app/backend/web;
  52. index index.php index.html;
  53.  
  54. server_name backend.dolist.dev;
  55.  
  56. charset utf-8;
  57.  
  58. client_max_body_size 16m;
  59.  
  60. # There is a VirtualBox bug related to sendfile that can lead to
  61. # corrupted files, if not turned-off on Vagrant based setup
  62. # sendfile off;
  63.  
  64. location / {
  65. try_files $uri $uri/ /index.php?$args;
  66. }
  67.  
  68. # location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ {
  69. # access_log off;
  70. # expires max;
  71. # }
  72.  
  73. location ~ \.php$ {
  74. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  75. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  76. fastcgi_pass php-fpm;
  77. fastcgi_index index.php;
  78. include fastcgi_params;
  79. }
  80.  
  81. }
  82.  
  83. ## STORAGE ##
  84. server {
  85. listen 80;
  86. server_name storage.dolist.dev;
  87.  
  88. root /app/storage/web;
  89. index index.html;
  90. # expires max;
  91.  
  92. # There is a VirtualBox bug related to sendfile that can lead to
  93. # corrupted files, if not turned-off
  94. # sendfile off;
  95.  
  96. location / {
  97. try_files $uri $uri/ /index.php?$args;
  98. }
  99.  
  100. location ~ \.php$ {
  101. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  102. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  103. fastcgi_pass php-fpm;
  104. fastcgi_index index.php;
  105. include fastcgi_params;
  106. }
  107. }
  108.  
  109. ## PHP-FPM Servers ##
  110. upstream php-fpm {
  111. server app:9000;
  112. }
  113.  
  114. ## MISC ##
  115.  
  116. ### WWW Redirect ###
  117. #server {
  118. # listen 80;
  119. # server_name www.dolist.dev;
  120. # return 301 http://dolist.dev$request_uri;
  121. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement