Advertisement
alpa_s

Untitled

May 15th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.09 KB | None | 0 0
  1. GLOBAL NGINX
  2.  
  3. server {
  4. listen 80;
  5.  
  6. server_name fazze.com;
  7.  
  8. location / {
  9. proxy_pass http://127.0.0.1:82;
  10. proxy_set_header Host fazze.com;
  11. proxy_set_header X-Forwarded-For $remote_addr;
  12. proxy_read_timeout 5s;
  13. }
  14.  
  15. }
  16.  
  17.  
  18.  
  19.  
  20.  
  21. DOCKER
  22.  
  23. server {
  24. listen 80;
  25. root /app;
  26. index index.php index.html;
  27. charset utf-8;
  28.  
  29. server_name fazze.com;
  30.  
  31. location ~* ^.+\.(jpg|jpeg|gif|png|ico|css|pdf|ppt|txt|bmp|rtf|js)$ {
  32. access_log off;
  33. expires max;
  34. }
  35.  
  36. location / {
  37. root /frontend;
  38. try_files $uri /frontend/web/index.php?$args;
  39. }
  40.  
  41. location /backend {
  42. try_files $uri /backend/web/index.php?$args;
  43. }
  44.  
  45. # storage access
  46. location /storage {
  47. try_files $uri /storage/web/index.php?$args;
  48. }
  49.  
  50. client_max_body_size 32m;
  51.  
  52. location ~ \.php$ {
  53. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  54. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  55. fastcgi_pass php-fpm;
  56. fastcgi_index index.php;
  57. include fastcgi_params;
  58.  
  59. ## Cache
  60. # fastcgi_pass_header Cookie; # fill cookie valiables, $cookie_phpsessid for exmaple
  61. # fastcgi_ignore_headers Cache-Control Expires Set-Cookie; # Use it with caution because it is cause SEO problems
  62. # fastcgi_cache_key "$request_method|$server_addr:$server_port$request_uri|$cookie_phpsessid"; # generating unique key
  63. # fastcgi_cache fastcgi_cache; # use fastcgi_cache keys_zone
  64. # fastcgi_cache_path /tmp/nginx/ levels=1:2 keys_zone=fastcgi_cache:16m max_size=256m inactive=1d;
  65. # fastcgi_temp_path /tmp/nginx/temp 1 2; # temp files folder
  66. # fastcgi_cache_use_stale updating error timeout invalid_header http_500; # show cached page if error (even if it is outdated)
  67. # fastcgi_cache_valid 200 404 10s; # cache lifetime for 200 404;
  68. # or fastcgi_cache_valid any 10s; # use it if you want to cache any responses
  69. }
  70. }
  71.  
  72. ## PHP-FPM Servers ##
  73. upstream php-fpm {
  74. server app:9000;
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement