所以上面的标题是我的问题。
首先..我的域名 app.com 使用的是 laravel,而门户使用的是 yii2,
所以 app.com 将通过 /var/www/app/public
我想要做的是浏览http://app.com/portal并将重定向到 /var/www/portal 内的新文件夹,但出现 404 未找到的情况。
我也读过以下主题
但无济于事
以下是我的配置
server {
listen 80;
listen 443 ssl;
#error_log /var/log/nginx/portal.log warn;
root /var/www/app/public;
index index.php index.html index.htm index.nginx-debian.html;
server_name app.com;
location / {
try_files $uri $uri/ /index.php?$is_args$args;
}
include snippets/self-signed.conf;
include snippets/ssl-params.conf;
location ~*.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
expires 7d;
log_not_found off;
access_log off;
fastcgi_hide_header "Set-Cookie";
}
location ~*.(css|js)$ {
expires 1d;
log_not_found off;
access_log off;
fastcgi_hide_header "Set-Cookie";
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ^~ /portal {
root /var/www;
#index index.php;
try_files $uri $uri/ /index.php;
location ~ \.php$ {
fastcgi_index index.php;
#include snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
location ~ /\.ht {
deny all;
}
}
*编辑,错误日志没有说明任何内容