|
|
bae4d5 |
{% set websites = ['news', 'planet', 'search', 'www', 'yast', '101', 'security', 'monitor', 'get', 'universe'] %}
|
|
Christian Boltz |
fa04e8 |
|
|
Christian Boltz |
fa04e8 |
include:
|
|
Christian Boltz |
fa04e8 |
- role.common.nginx
|
|
Christian Boltz |
fa04e8 |
|
|
Christian Boltz |
fa04e8 |
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
|
|
|
8a368b |
- ~text/: 1h
|
|
|
8a368b |
- ~image/: 1h
|
|
|
a20cbc |
- server:
|
|
|
a20cbc |
- server_name: {{ website }}.opensuse.org
|
|
|
a20cbc |
- listen:
|
|
|
1738ef |
{%- if website == 'news' %}
|
|
|
1738ef |
- '[::]:80 default_server'
|
|
|
1738ef |
{%- else %}
|
|
|
a20cbc |
- '[::]:80'
|
|
|
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
|
|
|
1738ef |
- try_files: $uri $uri/index.html $uri.html =404
|
|
|
a20cbc |
{% if website == 'news' %}
|
|
|
a20cbc |
- if ($args ~* "feed=rss2"):
|
|
|
a20cbc |
- set: $args ""
|
|
|
a20cbc |
- rewrite: ^.*$ https://news.opensuse.org/feed.xml redirect
|
|
|
a20cbc |
- rewrite: ^/feed/$ https://news.opensuse.org/feed.xml redirect
|
|
|
a20cbc |
- rewrite: ^.*/feed/$ https://news.opensuse.org/feed.xml redirect
|
|
|
a20cbc |
- rewrite: ^/feed$ https://news.opensuse.org/feed.xml redirect
|
|
|
a20cbc |
{% endif %}
|
|
|
a20cbc |
{% if website == 'planet' %}
|
|
|
a20cbc |
- rewrite: ^/global/$ / redirect
|
|
|
a20cbc |
- location ~ /tw(|/.*)$:
|
|
|
a20cbc |
- rewrite: ^/tw(.*)$ /zh_TW$1 redirect
|
|
|
a20cbc |
- location ~ /gr(|/.*)$:
|
|
|
a20cbc |
- rewrite: ^/gr(.*)$ /el$1 redirect
|
|
|
a20cbc |
{% endif %}
|
|
|
a20cbc |
- location ~* \.(?:ttf|otf|eot|woff)$:
|
|
|
a20cbc |
- add_header: Access-Control-Allow-Origin "*"
|
|
|
a20cbc |
- location ~* \.(?:xml)$:
|
|
|
a20cbc |
- add_header: Access-Control-Allow-Origin "*"
|
|
|
a20cbc |
- charset: utf-8
|
|
|
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
|
|
|
802c61 |
{%- if website == 'security' %}
|
|
|
802c61 |
- error_page: 404 /404.html
|
|
|
802c61 |
- location = /404.html:
|
|
|
802c61 |
- internal: ''
|
|
|
802c61 |
{%- endif %}
|
|
|
a20cbc |
- access_log: /var/log/nginx/{{ website }}.access.log combined
|
|
|
a20cbc |
- error_log: /var/log/nginx/{{ website }}.error.log
|
|
|
a20cbc |
enabled: True
|
|
|
a20cbc |
{% endfor %}
|
|
Stasiek Michalski |
6ff891 |
|
|
Stasiek Michalski |
6ff891 |
profile:
|
|
Stasiek Michalski |
6ff891 |
web_jekyll:
|
|
Stasiek Michalski |
2291b6 |
ssh_pubkey: 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAINNg3043py2Oe/LfLU0+mE+ehe7gI3e2QajbSUI6p4Zm web_jekyll@salt'
|
|
Stasiek Michalski |
6ff891 |
websites: {{ websites }}
|
|
Sasi Olin |
2638ac |
postfix:
|
|
Sasi Olin |
2638ac |
aliases:
|
|
Sasi Olin |
2638ac |
web_jekyll: root
|