Advertisement
Guest User

Untitled

a guest
Jul 12th, 2016
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.36 KB | None | 0 0
  1. server {
  2.         listen 80;
  3.  
  4.         server_name my-domain.com;
  5.  
  6.         root /home/jashka/sites/example/public;
  7.         index index.php;
  8.  
  9.         error_log /home/jashka/sites/GlobalAppError.log;
  10.  
  11.         location / {
  12.                 try_files $uri $uri/ /index.php$is_args$args;
  13.         }
  14.  
  15.         location ^~ /test-api {
  16.                 root /home/jashka/sites/TestWebServiceAPI/public;
  17.                 try_files $uri $uri/ @testapi;
  18.                 index index.php;
  19.  
  20.                 location ~ \.php {
  21.                         try_files $uri /index.php =404;
  22.                         fastcgi_index index.php;
  23.                         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  24.                         fastcgi_split_path_info ^(.+\.php)(.*)$;
  25.                         fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  26.                         include fastcgi_params;
  27.                 }
  28.         }
  29.  
  30.         location @testapi {
  31.                 rewrite /test-api/(.*)$ /test-api/index.php last; #index.php?$1
  32.         }
  33.  
  34.         location ~ .php$ {
  35.                 try_files $uri /index.php =404;
  36.                 fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  37.                 fastcgi_index index.php;
  38.                 fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  39.                 include fastcgi_params;
  40.         }
  41.  
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement