alpa_s

Untitled

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