|
4 | 4 | synchronize:
|
5 | 5 | src: "{{ role_path }}/vendor/server-configs-nginx/h5bp"
|
6 | 6 | dest: /etc/nginx
|
7 |
| -- set_fact: |
8 |
| - nginx_conf_template: "{{ role_path }}/templates/nginx/nginx.conf.j2" |
9 | 7 | - name: Setup Nginx
|
10 | 8 | vars:
|
11 |
| - nginx_ppa_use: true |
12 |
| - nginx_vhosts: [] |
13 |
| - __nginx_user: "stackhead" |
14 |
| - root_group: "stackhead" |
| 9 | + nginx_main_template_enable: 1 |
| 10 | + nginx_html_demo_template_enable: 1 |
| 11 | + nginx_main_template: |
| 12 | + user: "stackhead" |
| 13 | + http_custom_options: |
| 14 | + # Add X-XSS-Protection for HTML documents. /etc/nginx/h5bp/security/x-xss-protection.conf |
| 15 | + - "map $sent_http_content_type $x_xss_protection {\n ~*text/html \"1; mode=block\";\n }" |
| 16 | + # Add X-Frame-Options for HTML documents. /etc/nginx/h5bp/security/x-frame-options.conf |
| 17 | + - "map $sent_http_content_type $x_frame_options {\n ~*text/html DENY;\n }" |
| 18 | + # Add Content-Security-Policy for HTML documents. /etc/nginx/h5bp/security/content-security-policy.conf |
| 19 | + - "map $sent_http_content_type $content_security_policy {\n ~*text/html \"default-src 'self'; base-uri 'none'; form-action 'self'; frame-ancestors 'none'; upgrade-insecure-requests\";\n }" |
| 20 | + # Add Referrer-Policy for HTML documents. /etc/nginx/h5bp/security/referrer-policy.conf.conf |
| 21 | + - "map $sent_http_content_type $referrer_policy {\n ~*text/html \"strict-origin-when-cross-origin\";\n }" |
| 22 | + # Add X-UA-Compatible for HTML documents. /etc/nginx/h5bp/internet_explorer/x-ua-compatible.conf |
| 23 | + - "map $sent_http_content_type $x_ua_compatible {\n ~*text/html \"IE=edge\";\n }" |
| 24 | + # Add Access-Control-Allow-Origin. /etc/nginx/h5bp/cross-origin/requests.conf |
| 25 | + - "map $sent_http_content_type $cors {\n ~*image/ \"*\";\n ~*font/ \"*\";\n ~*application/vnd.ms-fontobject \"*\";\n ~*application/x-font-ttf \"*\";\n ~*application/font-woff \"*\";\n ~*application/x-font-woff \"*\";\n ~*application/font-woff2 \"*\";\n }" |
| 26 | + http_custom_includes: |
| 27 | + - /etc/nginx/h5bp/web_performance/compression.conf |
| 28 | + - /etc/nginx/h5bp/web_performance/cache_expiration.conf |
15 | 29 | include_role:
|
16 |
| - name: geerlingguy.nginx |
| 30 | + name: nginxinc.nginx |
17 | 31 | - name: adjust owner of /var/www directories
|
18 | 32 | file:
|
19 | 33 | path: /var/www
|
|
0 commit comments