Advertisement
Guest User

Untitled

a guest
May 14th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.94 KB | None | 0 0
  1. server {
  2.     set $host_path "/var/www";
  3.  
  4.     server_name localhost;
  5.     root   $host_path;
  6.  
  7.     charset utf-8;
  8.     client_max_body_size 100M;
  9.     sendfile off;
  10.  
  11.     location / {
  12.         proxy_pass  http://frontend:80;
  13.     }
  14.  
  15.     location ~ ^/api/.*$ {
  16.         root       $host_path/backend/public;
  17.         index      index.php;
  18.         try_files  $uri $uri/ /index.php?$query_string;
  19.     }
  20.  
  21.     location ~ \.php$ {
  22.             root $host_path/backend/public;
  23.             set $parsed_request_uri $request_uri;
  24.             if ($request_uri ~ ^/api/(.*)$ ) {
  25.                set $parsed_request_uri $1?$query_string;
  26.             }
  27.             include        fastcgi_params;
  28.             fastcgi_pass   backend:9000;
  29.             fastcgi_index  index.php;
  30.             fastcgi_param  SCRIPT_FILENAME  $host_path/public/index.php;
  31.             fastcgi_param  REQUEST_URI $parsed_request_uri;
  32.             fastcgi_read_timeout 3000;
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement