Elisei Roca 8a2096
{% set websites = ['html5test', 'people', 'shop', 'static', 'studioexpress', 'lizards', 'www', 'community', 'ignite', 'oom', 'mirrors'] %}
Theo Chatzimichos ec9fc0
19cb98
{%- if grains.get('country') == 'de' %} {#- no IPv6 yet in NUE #}
19cb98
{%- set listen = '80' %}
19cb98
{%- else %}
19cb98
{%- set listen = '[::]:80' %}
19cb98
{%- endif %}
19cb98
Theo Chatzimichos ec9fc0
include:
Theo Chatzimichos ec9fc0
  - role.common.nginx
Theo Chatzimichos ec9fc0
Theo Chatzimichos ec9fc0
nginx:
a20cbc
  servers:
a20cbc
    managed:
a20cbc
      {% for website in websites %}
a20cbc
      {{ website }}.opensuse.org.conf:
a20cbc
        config:
a20cbc
          - map $sent_http_content_type $expires:
a20cbc
              - text/css: 7d
a20cbc
              - image/x-icon: 90d
a20cbc
              - ~application/: 28d
a20cbc
              - ~font/: 28d
a20cbc
              - ~text/: 1h
a20cbc
              - ~image/: 28d
a20cbc
          - server:
a20cbc
              - server_name: {{ website }}.opensuse.org
a20cbc
              - listen:
1738ef
                  {%- if website == 'static' %}
19cb98
                  - '{{ listen }} default_server'
1738ef
                  {%- else %}
19cb98
                  - '{{ listen }}'
1738ef
                  {%- endif %}
a20cbc
              - root: /srv/www/vhosts/{{ website }}.opensuse.org
a20cbc
              - gzip_vary: 'on'
a20cbc
              - gzip_min_length: 1000
a20cbc
              - gzip_comp_level: 5
df9bbf
              - gzip_types: text/plain text/xml text/x-js application/json text/css application/x-javascript application/javascript
a20cbc
              - expires: $expires
a20cbc
              - location ~ /\.svn:
a20cbc
                  - return: 404
a20cbc
              - location ~ /\.git:
a20cbc
                  - return: 404
a20cbc
              - location /:
ee70ed
                  - index: index.html index.htm
a20cbc
              - location ~* \.(?:ttf|otf|eot|woff)$:
a20cbc
                  - add_header: Access-Control-Allow-Origin "*"
a20cbc
              {% if website == 'static' %}
a20cbc
              - location ~ ^/chat/:
a20cbc
                  - add_header: Access-Control-Allow-Origin "*"
a20cbc
              - location ~ ^/themes/:
a20cbc
                  - autoindex: 'on'
a20cbc
              {% endif %}
46f9e8
              {%- if website == 'community' %}
46f9e8
              - autoindex: 'on'
46f9e8
              {%- endif %}
Elisei Roca 0b452f
              {%- if website == 'mirrors' %}
Elisei Roca 0b452f
              - rewrite: ^/report/mirrors/(.*)$ https://download.opensuse.org/report/mirrors/$1 redirect
Elisei Roca 0b452f
              {%- endif %}
a20cbc
              - error_page: 405 = $uri
a20cbc
              - error_page: 405 =200 $uri
a20cbc
              - error_page: 500 502 503 504 /50x.html
a20cbc
              - location = /50x.html:
a20cbc
                  - root: /srv/www/htdocs
a20cbc
              - access_log: /var/log/nginx/{{ website }}.access.log combined
a20cbc
              - error_log: /var/log/nginx/{{ website }}.error.log
a20cbc
        enabled: True
a20cbc
      {% endfor %}
Christian Boltz 9c011c
Christian Boltz 9c011c
profile:
Christian Boltz 9c011c
  web_static:
Christian Boltz c59b75
    ssh_pubkey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJVddqh51YNoPglOnSZ9BpYH1nXzBV5ahbu0yncyL+6s web_static@salt'
Christian Boltz 9c011c
    websites: {{ websites }}
Sasi Olin 2638ac
  postfix:
Sasi Olin 2638ac
    aliases:
Sasi Olin 2638ac
      web_static: root
f3eb85
f3eb85
zypper:
f3eb85
  packages:
f3eb85
    rsync: {}