以下のような構成ファイルがあります。
サーバー {
80を聞いてください。
サーバー名 localhost;
#charset utf-8;
ルート html/laravel/public;
インデックス index.html index.php;
#インデックス ファイルがない場合はフォルダを参照
自動索引オン;
#強制NOwww
if ($ホスト ~* ^www\.(.*))
{
$host_without_www $1 を設定します。
^/(.*)$ $scheme://$host_without_www/$1 永久に書き換えます。
}
# 静的ファイルを直接提供
場所 ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
#最大期限切れ;
}
# 末尾のスラッシュを削除します (SEO 重複コンテンツの問題を防ぎます)
if (!-d $request_filename)
{
^/(.+)/$ /$1 永続的に書き換えます。
}
# codeigniter URL エンドポイントを正規化する
# デフォルトのコントローラーが「welcome」以外の場合、以下を変更する必要があります
# if ($request_uri ~* ^(/lobby(/index)?|/index(.php)?)/?$)
# {
# 書き換える ^(.*)$ / 永久;
# }
# すべてのコントローラから末尾の「インデックス」を削除します
if ($request_uri ~* index/?$)
{
^/(.*)/index/?$ /$1 永久に書き換えます。
}
# リクエストが有効なファイル (画像、js、css など) に対するものでない限り、ブートストラップに送信
if (!-e $request_filename)
{
^/(.*)$ /index.php?/$1 最後に書き換えます。
壊す;
}
# サーバーエラーページを静的ページ /50x.html にリダイレクト
#
error_page 500 502 503 504 /50x.html;
場所 = /50x.html {
ルート html;
}
ロケーション/バックエンド/ {
ルート/html/フロントエンド;
}
場所 ~ \.php$ {
fastcgi.conf を含めます。
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_params を含めます。
}
場所 ~ /\.ht {
すべてを否定します。
}
# すべてキャッチ
# error_page 404 /index.php;
# 場所 ~ \.php$ {
# try_files $uri =404;
# fastcgi_pass unix:/tmp/php.socket;
# fastcgi_index index.php;
# #include fastcgi_params;
# include /home/tamer/code/nginx/fastcgi_params;
# }
# access_log /home/tamer/code/laravel/storage/logs.access.log;
# error_log /home/tamer/code/laravel/storage/logs.error.log;
}
html/backendで任意の URL のルート フォルダーを に変更する必要があります$host/backend/。ロード ページのルールはすべて同じにする必要があり、変更する必要があるのはルート フォルダーのみです。
どうやってやるの?