Я хочу реализовать с помощью nginx следующее :
https://www.example.com/project1 -> / data / www / pro1 / public
https://www.example.com/project2 -> / data / www / pro2 / public
Вот моя конфигурация nginx :
server {
listen 80;
server_name www.example.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name www.example.com;
index index.html index.php;
root html;
rewrite_log on;
error_log /data/wwwlogs/itjuzi/xxxerror.log debug;
access_log /data/wwwlogs/itjuzi/saas.itjuzi.com.log access;
location /project1 {
alias /data/www/pro1/public;
try_files $uri $uri/ @pro1;
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param HTTPS on;
fastcgi_param HTTP_SCHEME https;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $request_filename;
}
}
location @pro1 {
rewrite /project1/(.*)$ /project1/index.php?/$1 last;
}
Это правильно обращается к index.php проекта pro1.
Но адрес браузера странный:
https://www.example.com/https:/www.example.com/project1/login
Эта проблема беспокоит меня весь день.
ПОМОГИ МНЕ! !! СПАСИБО ^ _ ^