server {
    listen 8080;
    index index.php index.html;
    error_log  /var/log/nginx/error.log;
    access_log /var/log/nginx/access.log;
    root /var/www/public;
    resolver 127.0.0.11;
    client_max_body_size 0;

    location / {
        add_header 'Access-Control-Allow-Origin' '*';
        add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
        add_header 'Access-Control-Allow-Headers' 'X-Requested-With,X-Token-Auth,Cache-Control,Content-Type,Authorization';
        try_files $uri /index.php$is_args$args;
        gzip_static on;
    }

    location /mssql/ {
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        if ($request_uri ~* "/mssql/(.*)") {
            proxy_pass http://phpmyadmin:80/$1;
        }
    }
}
