Зачем алиас? Рута нового пропишите!
2014-03-12 13:38 GMT+04:00 georgiy_s <[email protected]>: > Насколько понимаю, это должно выглядеть так: > > server { > listen 80; > server_name test.loc; > root /var/www/test; > > error_log /var/log/nginx/mytest.log; > index index.html index.php; > > location / { > > index index.html index.php; > try_files $uri $uri/ /index.php?$args; > set $root /var/www/test; > > > } > > location /sample { > > index index.html index.php; > try_files $uri $uri/ /index.php?$args; > alias /var/www/test2; > > location ~ \.php$ { > include fastcgi_params; > fastcgi_param PATH_INFO $fastcgi_path_info; > fastcgi_index index.php; > fastcgi_param PATH_TRANSLATED > $document_root$fastcgi_script_name; > fastcgi_param SCRIPT_FILENAME > $document_root$fastcgi_script_name; > fastcgi_pass 127.0.0.1:9000; > } > } > > location ~ \.php$ { > #try_files $uri =404; > #fastcgi_split_path_info ^(.+\.php)(/.+)$; > #fastcgi_split_path_info ^(.+\.php)(.+)$; > > include fastcgi_params; > fastcgi_param PATH_INFO $fastcgi_path_info; > fastcgi_index index.php; > fastcgi_param PATH_TRANSLATED > $document_root$fastcgi_script_name; > fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; > fastcgi_pass 127.0.0.1:9000; > } > > } > > всё теперь почти работает. но присутвтвует привязка к названию алиаса. т.е. > мы прописываем алиас sample и поэтому по урлу > http://test.loc/sample/index.php запрашивается файл > /var/www/test2/sample/index.php , а нужен файл /var/www/test2/index.php . > > подскажите, пожалуйста, как разрешить эту зависимость? > > Posted at Nginx Forum: > http://forum.nginx.org/read.php?21,248289,248294#msg-248294 > > _______________________________________________ > nginx-ru mailing list > [email protected] > http://mailman.nginx.org/mailman/listinfo/nginx-ru >
_______________________________________________ nginx-ru mailing list [email protected] http://mailman.nginx.org/mailman/listinfo/nginx-ru
