我通过PHP 5.4和Nginx的预先配置的https://puphpet.com/包设置我的流浪盒。
配置完成后,我总是要自己更改vhost_autogen.conf - 我想这不可能是流浪者和傀儡背后的想法:-)我怎么能:
OR
这是必需的虚拟主机设置:
服务器{
听*:80;
server_name example.dev www.example.dev;
root /var/www/example.com;
index index.php;
access_log /var/log/nginx/example.com.de.access.log;
error_log /var/log/nginx/example.com.error.log;
if($ host~ * www。(。*)){ 设置$ host_without_www $ 1; 重写^(。*)$ $ scheme:// $ host_without_www $ 1 permanent; #1 #rewrite ^ $ scheme:// $ host_without_www $ 1request_uri permanent; #2 }
#重写minify 重写^ / min /([a-z] =。*)/min/index.php?$1 last;
#canonicalize codeigniter url end points
if($ request_uri~ * ^(/ start(/ index)?| / index(.php)?)/?$) { 重写^(。*)$ / permanent; }
#从所有控制器中删除尾随的“索引” if($ request_uri~ * index /?$) { 重写^ /(。*)/ index /?$ / $ 1 permanent; }
#删除尾部斜杠(防止SEO重复内容问题) if(!-d $ request_filename) { 重写^ /(。+)/ $ / $ 1永久; }
#删除对“system”文件夹的访问权限,也允许“System.php”控制器 if($ request_uri~ * ^ / system) { 最后重写^ /(。*)$ /index.php?/$1; 打破; }
#除非请求是针对有效文件(图像,js,css等),否则发送到bootstrap if(!-e $ request_filename) { 最后重写^ /(。*)$ /index.php?/$1; 打破; }
#catch all error_page 404 /index.php;
location / { root /var/www/example.com; 重写^ / min /([a-z] =。*)/min/index.php?$1 last; }
location = /robots.txt {access_log off; log_not_found off; } location = /favicon.ico {access_log off; log_not_found off; } 位置〜/。 {access_log off; log_not_found off;否认所有; } location ~~ $ {access_log off; log_not_found off;否认所有; }
location~.php $ { root /var/www/example.com; try_files $ uri $ uri / /index.php?$args; index index.html index.htm index.php; fastcgi_index index.php; fastcgi_param PATH_INFO $ fastcgi_path_info; fastcgi_param PATH_TRANSLATED $ document_root $ fastcgi_path_info; fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name; fastcgi_param APP_ENV dev;
fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_split_path_info ^(.+\.php)(/.+)$; include fastcgi_params;
} }
答案 0 :(得分:0)
在puppet/manifest.pp
中,搜索create_resources(nginx_vhost, $nginx_values['vhosts'])
,将其替换为以下内容:
file { "/etc/nginx/sites-enabled/my-site.conf":
source => '/full/path/to/conf/file',
owner => 'root',
group => 'root',
mode => '0644'
}