-
-
Notifications
You must be signed in to change notification settings - Fork 875
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed long names virtual hosts... #233
Changes from 4 commits
e94af12
088f141
a4ddf88
f4d543e
22b3f5a
d340eea
26cf99c
325ae7e
520b8fe
2252d96
6997df9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -165,3 +165,66 @@ nginx::resource::vhost { 'puppet': | |
}, | ||
} | ||
``` | ||
|
||
### Example puppet class calling nginx::vhost with HTTPS FastCGI and redirection of HTTP | ||
|
||
```define web::nginx_ssl_with_redirect ( | ||
$backend_port = 9000, | ||
$php = true, | ||
$proxy = undef, | ||
$www_root = "${full_web_path}/${name}/", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where does value for |
||
$location_cfg_append = undef, | ||
) { | ||
nginx::resource::vhost { "${name}.${::domain}": | ||
ensure => present, | ||
www_root => "${full_web_path}/${name}/", | ||
location_cfg_append => { 'rewrite' => '^ https://$server_name$request_uri? permanent' }, | ||
} | ||
|
||
if !$www_root { | ||
$tmp_www_root = undef | ||
} else { | ||
$tmp_www_root = $www_root | ||
} | ||
|
||
nginx::resource::vhost { "${name}.${::domain} ${name}": | ||
ensure => present, | ||
listen_port => 443, | ||
www_root => $tmp_www_root, | ||
proxy => $proxy, | ||
location_cfg_append => $location_cfg_append, | ||
index_files => [ 'index.php' ], | ||
ssl => true, | ||
ssl_cert => 'puppet:///modules/sslkey/whildcard_mydomain.crt', | ||
ssl_key => 'puppet:///modules/sslkey/whildcard_mydomain.key', | ||
} | ||
|
||
|
||
if $php { | ||
nginx::resource::location { "${name}_root": | ||
ensure => present, | ||
ssl => true, | ||
ssl_only => true, | ||
vhost => "${name}.${::domain} ${name}", | ||
www_root => "${full_web_path}/${name}/", | ||
location => '~ \.php$', | ||
index_files => ['index.php', 'index.html', 'index.htm'], | ||
proxy => undef, | ||
fastcgi => "127.0.0.1:${backend_port}", | ||
fastcgi_script => undef, | ||
location_cfg_append => { | ||
fastcgi_connect_timeout => '3m', | ||
fastcgi_read_timeout => '3m', | ||
fastcgi_send_timeout => '3m' | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
# Call class web::nginx_ssl_with_redirect | ||
|
||
```web::nginx_ssl_whith_redirect { 'sub-domain-name': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's also a typo in this example - |
||
backend_port => 9001, | ||
} | ||
``` |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
include nginx | ||
|
||
nginx::resource::vhost { 'test2.local test2': | ||
ensure => present, | ||
www_root => '/var/www/nginx-default', | ||
ssl => true, | ||
ssl_cert => 'puppet:///modules/sslkey/whildcard_mydomain.crt', | ||
ssl_key => 'puppet:///modules/sslkey/whildcard_mydomain.key' | ||
} | ||
|
||
nginx::resource::location { 'test2.local-bob': | ||
ensure => present, | ||
www_root => '/var/www/bob', | ||
location => '/bob', | ||
vhost => 'test2.local test2', | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you preview this new section in the README? It doesn't render properly. The
must be on a line of its own, and it should read
to get proper syntax highlighting.