Commit dc3c60809f249ade3ceb88198e6910bb0a7d972e

Authored by root ago
1 parent 35123f3605
Exists in master

real server configuration has added.

Showing 5 changed files with 108 additions and 19 deletions Side-by-side Diff

manifests/web-proxy.pp View file @ dc3c608
1   -node 'localhost' {
  1 +node 'KR-WEB-PROXY-01' {
2 2 include nginx
3   - include haproxy
  3 +
  4 + file { '/etc/nginx':
  5 + ensure => directory,
  6 + }
  7 +
  8 + file { 'nginx.conf':
  9 + path => '/etc/nginx/nginx.conf',
  10 + ensure => present,
  11 + source => 'puppet:///modules/nginx/nginx.conf.webproxy.real',
  12 + }
  13 +
  14 + file { 'fastcgi.conf':
  15 + path => '/etc/nginx/fastcgi.conf',
  16 + ensure => present,
  17 + source => 'puppet:///modules/nginx/fastcgi.conf.webproxy.real',
  18 + }
  19 +
  20 + file { '/etc/nginx/conf.d':
  21 + ensure => directory,
  22 + recurse => true,
  23 + purge => true,
  24 + before => File['httpd.conf'],
  25 + }
  26 +
  27 + file { 'httpd.conf':
  28 + path => '/etc/nginx/conf.d/http.conf',
  29 + ensure => present,
  30 + source => 'puppet:///modules/nginx/http.conf.webproxy.real',
  31 + }
  32 +
  33 + include haproxy
  34 +
  35 + file { '/etc/haproxy':
  36 + ensure => directory,
  37 + }
  38 +
  39 + file { 'haproxy.cfg':
  40 + path => '/etc/haproxy/haproxy.cfg',
  41 + ensure => present,
  42 + source => 'puppet:///modules/haproxy/haproxy.cfg.webproxy.real',
  43 + }
4 44 }
manifests/web-server.pp View file @ dc3c608
1   -node 'localhost' {
  1 +node /^KR-WEB-\d+$/ {
2 2 include php
  3 +
  4 + file { '/etc/php-fpm.d':
  5 + ensure => directory,
  6 + }
  7 +
  8 + file { 'www.conf':
  9 + path => '/etc/php-fpm.d/www.conf',
  10 + ensure => present,
  11 + source => 'puppet:///modules/php/www.conf.webserver.real',
  12 + }
  13 +
  14 + file { 'php.ini':
  15 + path => '/etc/php.ini',
  16 + ensure => present,
  17 + source => 'puppet:///modules/php/php.ini.webserver.real',
  18 + }
  19 +
3 20 }
modules/nginx/files/fastcgi.conf.webproxy.real View file @ dc3c608
  1 +fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  2 +fastcgi_param QUERY_STRING $query_string;
  3 +fastcgi_param REQUEST_METHOD $request_method;
  4 +fastcgi_param CONTENT_TYPE $content_type;
  5 +fastcgi_param CONTENT_LENGTH $content_length;
  6 +
  7 +fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  8 +fastcgi_param REQUEST_URI $request_uri;
  9 +fastcgi_param DOCUMENT_URI $document_uri;
  10 +fastcgi_param DOCUMENT_ROOT $document_root;
  11 +fastcgi_param SERVER_PROTOCOL $server_protocol;
  12 +
  13 +fastcgi_param GATEWAY_INTERFACE CGI/1.1;
  14 +fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
  15 +
  16 +fastcgi_param REMOTE_ADDR $remote_addr;
  17 +fastcgi_param REMOTE_PORT $remote_port;
  18 +fastcgi_param SERVER_ADDR $server_addr;
  19 +fastcgi_param SERVER_PORT $server_port;
  20 +fastcgi_param SERVER_NAME $server_name;
  21 +
  22 +# PHP only, required if PHP was built with --enable-force-cgi-redirect
  23 +fastcgi_param REDIRECT_STATUS 200;
modules/nginx/files/http.conf.webproxy.real View file @ dc3c608
  1 +server {
  2 + listen 80;
  3 + sever_name pikicast.com;
  4 +
  5 + root /var/www/pikicast-web-ci;
  6 + index index.html index.php;
  7 +
  8 + location ~* \.(ico|css|js|gif|jpe?g|png)(\?[0-9]+)?$ {
  9 + expires max;
  10 + log_not_found off;
  11 + }
  12 +
  13 + location / {
  14 + try_files $uri $uri/ /index.php;
  15 + }
  16 +
  17 + location ~* \.php$ {
  18 + fastcgi_pass 127.0.0.1:8000;
  19 + include fastcgi.conf;
  20 + fastcgi_index index.php;
  21 + fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  22 + include fastcgi_params;
  23 + }
  24 +}
modules/nginx/files/nginx.conf.webproxy.real View file @ dc3c608
... ... @@ -43,21 +43,6 @@
43 43 sendfile on;
44 44 keepalive_timeout 30;
45 45  
46   - server {
47   - listen 80;
48   - server_name web-nginx;
49   -
50   - location / {
51   - proxy_pass http://127.0.0.1:10080;
52   - proxy_pass_request_headers on;
53   - }
54   - }
55   -
56   - server {
57   - listen 443;
58   - location / {
59   - proxy_pass http://localhost:19443;
60   - }
61   - }
  46 + include /etc/nginx/conf.d/*.conf;
62 47 }