Advertisement
Guest User

Untitled

a guest
May 29th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name www.website.com;
  4. return 301 $scheme://website.com$request_uri;
  5. }
  6.  
  7. server {
  8. listen 80;
  9.  
  10. server_name website.com;
  11. rewrite_log on;
  12.  
  13. index index.php index.html index.htm;
  14.  
  15. location / {
  16. root /var/www/website.com/public;
  17. try_files $uri $uri/ @rewrites;
  18. }
  19.  
  20. location /project1/ {
  21. root /var/www/website.com/project1/public;
  22. try_files $uri $uri/ @rewrites;
  23. }
  24.  
  25. location /project2/ {
  26. root /var/www/website.com/project2/public;
  27. try_files $uri $uri/ @rewrites;
  28. }
  29.  
  30. location @rewrites {
  31. rewrite ^(.*) /index.php?p=$1 last;
  32. }
  33.  
  34. location ~ .php$ {
  35. try_files $uri =404;
  36. fastcgi_split_path_info ^(.+.php)(/.+)$;
  37. fastcgi_pass unix:/var/run/php5-fpm.sock;
  38. fastcgi_index index.php;
  39. include fastcgi_params;
  40. }
  41.  
  42. location ~* .(?:ico|css|js|gif|jpe?g|png|woff|woff2|ttf|otf|svg)$ {
  43. try_files $uri /index.php?$query_string;
  44. expires 14d;
  45. }
  46.  
  47. error_page 404 /index.php;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement