laravel lumen project as subdirectory with nginx
-
Hi everyone,
I'm trying configure a project using lumen laravel with nginx on laragon.
But I'm having a problem when make it run as subdirectory.
Example domain run athttp://project.local/api/
and project located atD:\projects\api
Does someone has experiment with this case, please give me some suggestion.
There is my current configserver { listen 8172; server_name project.local; charset utf-8; root "D:/project/home"; index index.html index.htm index.php; location / { try_files $uri $uri/ /index.php?$query_string; } location ^~ /api { alias "D:/project/api"; try_files $uri $uri/ @siteApi; location ~ \.php$ { include snippets/fastcgi-php.conf; include fastcgi_params; fastcgi_pass php_upstream; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } } location @siteApi { rewrite ^/api/(.*)$ /api/index.php/$1 last; } location ~ \.php$ { include snippets/fastcgi-php.conf; include fastcgi_params; fastcgi_pass php_upstream; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } location ~ /\.ht { deny all; } gzip on; gzip_vary on; gzip_disable "msie6"; gzip_comp_level 9; gzip_min_length 1100; gzip_buffers 16 8k; gzip_proxied any; gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss; }
Thanks