Changeset - 7f8ef577fa2c
[Not reviewed]
0 1 0
Branko Majic (branko) - 9 years ago 2015-05-11 23:11:48
branko@majic.rs
MAR-5: Fixed syntax error. Updated formatting a bit to produce nicer-looking files.
1 file changed with 9 insertions and 7 deletions:
0 comments (0 inline, 0 general)
roles/php_website/templates/nginx_site.j2
Show inline comments
 
@@ -5,10 +5,12 @@ server {
 
    index {{ index }};
 
    server_name {{ fqdn }};
 

	
 
    {% if rewrites -%}
 
    # Generic URL rewrites.
 
    {% for rewrite in rewrites -%}
 
    rewrite {{ rewrite }};
 
    {% endfor %}
 
    {% endfor -%}
 
    {% endif %}
 

	
 
    {% if deny_files_regex -%}
 
    # Deny access to user-specified files.
 
@@ -16,7 +18,7 @@ server {
 
    location ~ {{ regex }} {
 
        deny all;
 
    }
 
    {% endfor %}
 
    {% endfor -%}
 
    {% endif %}
 

	
 
    # Interpret PHP files via FastCGI.
 
@@ -27,17 +29,17 @@ server {
 

	
 
    # Serve the files.
 
    location ~ /(.+) {
 
	try_files $uri $uri/{% if php_rewrite_urls %}@php_rewrite{% endif %};
 
	try_files $uri $uri/{% if php_rewrite_urls %} @php_rewrite{% endif %};
 
    }
 

	
 
    {% if php_rewrite_urls -%}
 
    # Apply URL rewrites.
 
    location @php_rewrite {
 
        {% for rewrite in php_rewrite_urls -%}
 
        rewrite {{ rewrite }};
 
        {% endfor %}
 
    {% for rewrite in php_rewrite_urls %}
 
    rewrite {{ rewrite }};
 
    {% endfor -%}
 
    }
 
    {% endif %}
 
    {% endif -%}
 

	
 
    access_log /var/log/nginx/{{ fqdn }}-access.log;
 
    error_log /var/log/nginx/{{ fqdn }}-error.log;
0 comments (0 inline, 0 general)