Advertisement
Guest User

Untitled

a guest
May 14th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.00 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 @rewrites {
  16.         rewrite ^(.+)$ / last;
  17.     }
  18.  
  19.     location ~ ^/api/.*$ {
  20.         root       $host_path/backend/public;
  21.         index      index.php;
  22.         try_files  $uri $uri/ /index.php?$query_string;
  23.     }
  24.  
  25.     location ~ \.php$ {
  26.             root $host_path/backend/public;
  27.             set $parsed_request_uri $request_uri;
  28.             if ($request_uri ~ ^/api/(.*)$ ) {
  29.                set $parsed_request_uri $1?$query_string;
  30.             }
  31.             include        fastcgi_params;
  32.             fastcgi_pass   backend:9000;
  33.             fastcgi_index  index.php;
  34.             fastcgi_param  SCRIPT_FILENAME  $host_path/public/index.php;
  35.             fastcgi_param  REQUEST_URI $parsed_request_uri;
  36.             fastcgi_read_timeout 3000;
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement