Seawed

my nginx

Feb 22nd, 2019
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2. listen 80;
  3. server_name *.farm.loc;
  4. index index.php;
  5.  
  6. gzip on;
  7. gzip_disable "msie6";
  8. gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascr$
  9.  
  10. set $app "www";
  11.  
  12. if ($host ~* ^([a-z0-9-]+)\.farm.loc$) {
  13. set $app $1;
  14. }
  15. if ($host ~* ^([a-z0-9-]+)\.([a-z0-9-]+)\.farm.loc$) {
  16. set $app $2;
  17. }
  18. if ($host ~* ^www.([a-z0-9-]+)\.farm.loc$) {
  19. set $app $1;
  20. rewrite ^/(.*)$ http://$app.farm.loc/$1 permanent;
  21. }
  22.  
  23.  
  24. set $root /var/www/farm.loc/$app/www;
  25. root $root;
  26.  
  27. location ~ ^/(img|js|css|font|less).+\.(gif|png|jpg|jpeg|js|css|svg|woff|ttf|less|otf|eot|map|ico) {
  28. access_log off;
  29. expires 7d;
  30. }
  31.  
  32.  
  33. location / {
  34. fastcgi_hide_header "Cache-Control";
  35. add_header Cache-Control "no-store, no-cache, must-revalidate, post-check=0, pre-check=0";
  36. fastcgi_pass unix:/var/run/php7.2-fpm.sock;
  37. fastcgi_param SCRIPT_FILENAME $root/index.php;
  38. fastcgi_param PATH_TRANSLATED $root/index.php;
  39. fastcgi_param PATH_INFO $fastcgi_path_info;
  40. fastcgi_keep_conn on;
  41. include fastcgi_params;
  42. }
  43. }
RAW Paste Data