我的域名就像example.com和nginx文件,如下所示。 所以我的根路径是/ var / www / campaignmanager / bannerad / public。
所以我的域名在example.com等浏览器中打开,但我想打开它像 example.com/campaignmanager 或 www.example.com/campaignmanager
请帮帮我。
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
答案 0 :(得分:0)
您可以使用服务器和位置指令的组合来完成它。
server {
listen 80;
listen [::]:80;
root /var/www/campaignmanager/bannerad/public;
index index.php index.html index.htm;
server_name exmaple.com/sample
location /sample {
try_files $uri $uri/index.html $uri.html @upstream;
}
location @upstream {
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
}
请原谅语法错误。 https://www.keycdn.com/support/nginx-location-directive/ http://nginx.org/en/docs/http/server_names.html