tarlepp/symfony-flex-backend

View on GitHub
docker/nginx/nginx.conf

Summary

Maintainability
Test Coverage
server {
    server_name app.localhost;
    root /app/public;

    location / {
        # try to serve file directly, fallback to index.php
        try_files $uri @rewriteapp;
    }

    location @rewriteapp {
        rewrite ^(.*)$ /index.php/$1 last;
    }

    location ~* \.php(/|$) {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        fastcgi_pass php-upstream;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param HTTPS off;
    }

    gzip on;
    gzip_disable "msie6";
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_buffers 16 8k;
    gzip_http_version 1.1;
    gzip_min_length 1024;
    gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
    gzip_static on;

    server_tokens off;
    disable_symlinks off;
    fastcgi_buffer_size 256k;
    fastcgi_buffers 4 512k;
    fastcgi_busy_buffers_size 512k;

    error_log /var/log/nginx/app_error.log;
    access_log /var/log/nginx/app_access.log combined buffer=64k flush=5m;
}