user www-data;

events {
    worker_connections 2048;
    use epoll;
}

http {
    keepalive_timeout 500;
    keepalive_requests 5000;

    client_max_body_size 32m;
    client_body_buffer_size 32m;

    sendfile on;
    server_tokens off;

    tcp_nopush on;
    tcp_nodelay on;
    reset_timedout_connection on;

    gzip on;
    gzip_comp_level 5;
    gzip_min_length 256;
    gzip_proxied any;
    gzip_types application/javascript application/json application/xml text/css text/plain text/xml;
    gzip_vary on;

    open_file_cache max=1000 inactive=20s;
    open_file_cache_valid 30s;
    open_file_cache_min_uses 2;
    open_file_cache_errors on;

    #upstream php-fpm {
    #    server 127.0.0.1:9000 max_fails=5 fail_timeout=5s;
    #}

    server {
        listen 80;
        server_name testdgpe.duckdns.org dgpe.duckdns.org dgpe.theworkpc.com;

        root /var/www/public;
        index index.php;

        error_log  /var/log/nginx/error.log;
        access_log /var/log/nginx/access.log;

        include /etc/nginx/mime.types;

        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        location ~ \.php$ {
            fastcgi_pass site_owendo:9000;
            fastcgi_index index.php;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_param SCRIPT_NAME $fastcgi_script_name;
            include fastcgi_params;
        }
        

        location ~ /.well-known/acme-challenge/ {
            root /var/www/certbot;
        }

        

    }
}
