Untitled
raw download clone
TEXT
views 14
,
size 2311 b
server {
root /var/www/html/player;
server_name player.duniacinema21.me;
access_log /var/log/nginx/wp_client_access.log;
error_log /var/log/nginx/wp_client_error.log;

location / {
    index index.php index.html;
    try_files $uri $uri/ /index.php?$args;

}
# Specify a charset
        charset utf-8;
# GZIP
    gzip                on;
    gzip_static         on;
    gzip_vary           on;
    gzip_comp_level     6;
    gzip_min_length     1024;
    gzip_buffers        16 8k;
    gzip_types          text/plain text/css text/javascript text/js text/xml application/json application/javascript application/x-javascript application/xml application/xml+rss application/x-font-ttf image/svg+xml font/opentype;
    gzip_proxied        any;
    gzip_disable        "MSIE [1-6]\.";

# Add trailing slash to */wp-admin requests.
        rewrite /wp-admin$ $scheme://$host$uri/ permanent;

# Prevents hidden files (beginning with a period) from being served
location ~ /\. {
        access_log off;
        log_not_found off;
        deny all;
}

###########
# SEND EXPIRES HEADERS AND TURN OFF 404 LOGGING
###########

        location ~* ^.+.(ico|css|js|gif|jpe?g|png|xml|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
        access_log off;
        log_not_found off;
        expires 30d;
        access_log off;
        add_header Pragma public;
        add_header Cache-Control "public";
        add_header Cache-Control private;
        add_header Cache-control max-age=120;
        add_header Cache-Control s-maxage=200;        
        break;
}

# Pass all .php files onto a php-fpm or php-cgi server
location ~ \.php$ {
        try_files $uri =404;
        include /etc/nginx/fastcgi_params;
        fastcgi_read_timeout 3600s;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 4 128k;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_pass unix:/run/php/php7.2-fpm.sock;
        fastcgi_index index.php;
}

# ROBOTS
location = /robots.txt {
    allow all;
    log_not_found off;
    access_log off;
    }

# RESTRICTIONS
    location ~* /(?:uploads|files)/.*\.php$ {
    deny all;
    }
}
close fullscreen
Login or Register to edit or fork this paste. It's free.