【发布时间】:2021-06-19 06:48:02
【问题描述】:
嗨,我是一名 laravel 开发人员。在 envato 工作。我有一些 laravel 项目。我想为我的 laravel 项目进行自定义配置。
例子
-
http://demo.jubayed.com/demo5/
root demo.jubayed.com/$demoProject/
server {
listen 80;
server_name demo.jubayed.com;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
index index.php;
charset utf-8;
location /($demoProject)/ {
try_files $uri $uri/ /index.php?$query_string;
root /var/www/$demoProject/public;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
location = /sitemap.xml { access_log off; log_not_found off; }
error_page 404 /index.php;
# error_page 500 /index.php;
# error_page 401 /index.php;
# error_page 403 /index.php;
location ~ \.php$ {
fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ /\.(?!well-known).* {
deny all;
}
}
【问题讨论】:
标签: php laravel nginx dynamic path